1.\" Copyright (c) 1998, Matthew Dillon. Terms and conditions are those of 2.\" the BSD Copyright as specified in the file "/usr/src/COPYRIGHT" in 3.\" the source tree. 4.\" 5.\" $FreeBSD$ 6.\" 7.Dd September 18, 1999 8.Dt SECURITY 7 9.Os 10.Sh NAME 11.Nm security 12.Nd introduction to security under FreeBSD 13.Sh DESCRIPTION 14Security is a function that begins and ends with the system administrator. 15While all 16.Bx 17multi-user systems have some inherent security, the job of building and 18maintaining additional security mechanisms to keep users 19.Sq honest 20is probably 21one of the single largest undertakings of the sysadmin. Machines are 22only as secure as you make them, and security concerns are ever competing 23with the human necessity for convenience. 24.Ux 25systems, 26in general, are capable of running a huge number of simultaneous processes 27and many of these processes operate as servers - meaning that external entities 28can connect and talk to them. As yesterday's mini-computers and mainframes 29become today's desktops, and as computers become networked and internetworked, 30security becomes an ever bigger issue. 31.Pp 32Security is best implemented through a layered onion approach. In a nutshell, 33what you want to do is to create as many layers of security as are convenient 34and then carefully monitor the system for intrusions. You do not want to 35overbuild your security or you will interfere with the detection side, and 36detection is one of the single most important aspects of any security 37mechanism. For example, it makes little sense to set the 38.Pa schg 39flags 40(see 41.Xr chflags 1 ) 42on every system binary because while this may temporarily protect the 43binaries, it prevents a hacker who has broken in from making an 44easily detectable change that may result in your security mechanisms not 45detecting the hacker at all. 46.Pp 47System security also pertains to dealing with various forms of attack, 48including attacks that attempt to crash or otherwise make a system unusable 49but do not attempt to break root. Security concerns can be split up into 50several categories: 51.Bl -enum -offset indent 52.It 53Denial of service attacks 54.It 55User account compromises 56.It 57Root compromise through accessible servers 58.It 59Root compromise via user accounts 60.It 61Backdoor creation 62.El 63.Pp 64A denial of service attack is an action that deprives the machine of needed 65resources. Typically, D.O.S. attacks are brute-force mechanisms that attempt 66to crash or otherwise make a machine unusable by overwhelming its servers or 67network stack. Some D.O.S. attacks try to take advantages of bugs in the 68networking stack to crash a machine with a single packet. The latter can 69only be fixed by applying a bug fix to the kernel. Attacks on servers can 70often be fixed by properly specifying options to limit the load the servers 71incur on the system under adverse conditions. Brute-force network 72attacks are harder to deal with. A spoofed-packet attack, for example, is 73nearly impossible to stop short of cutting your system off from the Internet. 74It may not be able to take your machine down, but it can fill up Internet 75pipe. 76.Pp 77A user account compromise is even more common than a D.O.S. attack. Many 78sysadmins still run standard telnetd, rlogind, rshd, and ftpd servers on their 79machines. These servers, by default, do not operate over encrypted 80connections. The result is that if you have any moderate-sized user base, 81one or more of your users logging into your system from a remote location 82(which is the most common and convenient way to login to a system) 83will 84have his or her password sniffed. The attentive system admin will analyze 85his remote access logs looking for suspicious source addresses 86even for successful logins. 87.Pp 88One must always assume that once an attacker has access to a user account, 89the attacker can break root. However, the reality is that in a well secured 90and maintained system, access to a user account does not necessarily give the 91attacker access to root. The distinction is important because without access 92to root the attacker cannot generally hide his tracks and may, at best, be 93able to do nothing more than mess with the user's files or crash the machine. 94User account compromises are very common because users tend not to take the 95precautions that sysadmins take. 96.Pp 97System administrators must keep in mind that there are potentially many ways 98to break root on a machine. The attacker may know the root password, 99the attacker 100may find a bug in a root-run server and be able to break root over a network 101connection to that server, or the attacker may know of a bug in an suid-root 102program that allows the attacker to break root once he has broken into a 103user's account. If an attacker has found a way to break root on a machine, 104the attacker may not have a need to install a backdoor. 105Many of the root holes found and closed to date involve a considerable amount 106of work by the hacker to cleanup after himself, so most hackers do install 107backdoors. This gives you a convenient way to detect the hacker. Making 108it impossible for a hacker to install a backdoor may actually be detrimental 109to your security because it will not close off the hole the hacker found to 110break in the first place. 111.Pp 112Security remedies should always be implemented with a multi-layered 113.Sq onion peel 114approach and can be categorized as follows: 115.Bl -enum -offset indent 116.It 117Securing root and staff accounts 118.It 119Securing root - root-run servers and suid/sgid binaries 120.It 121Securing user accounts 122.It 123Securing the password file 124.It 125Securing the kernel core, raw devices, and file systems 126.It 127Quick detection of inappropriate changes made to the system 128.It 129Paranoia 130.El 131.Sh SECURING THE ROOT ACCOUNT AND SECURING STAFF ACCOUNTS 132Don't bother securing staff accounts if you haven't secured the root 133account. Most systems have a password assigned to the root account. The 134first thing you do is assume that the password is 135.Sq always 136compromised. This does not mean that you should remove the password. The 137password is almost always necessary for console access to the machine. 138What it does mean is that you should not make it possible to use the password 139outside of the console or possibly even with a 140.Xr su 1 141command. 142For example, make sure that your pty's are specified as being unsecure 143in the 144.Sq Pa /etc/ttys 145file 146so that direct root logins via telnet or rlogin are disallowed. If using 147other login services such as sshd, make sure that direct root logins are 148disabled there as well. Consider every access method - services such as 149ftp often fall through the cracks. Direct root logins should only be allowed 150via the system console. 151.Pp 152Of course, as a sysadmin you have to be able to get to root, so we open up 153a few holes. But we make sure these holes require additional password 154verification to operate. One way to make root accessible is to add appropriate 155staff accounts to the wheel group 156(in 157.Pa /etc/group ) . 158The staff members placed 159in the wheel group are allowed to 160.Sq su 161to root. You should never give staff 162members native wheel access by putting them in the wheel group in their 163password entry. Staff accounts should be placed in a 164.Sq staff 165group, and then added to the wheel group via the 166.Sq Pa /etc/group 167file. Only those staff members who actually need to have root access 168should be placed in the wheel group. It is also possible, when using an 169authentication method such as kerberos, to use kerberos's 170.Sq Pa .k5login 171file in the root account to allow a 172.Xr ksu 1 173to root without having to place anyone at all in the wheel group. This 174may be the better solution since the wheel mechanism still allows an 175intruder to break root if the intruder has gotten hold of your password 176file and can break into a staff account. While having the wheel mechanism 177is better than having nothing at all, it isn't necessarily the safest 178option. 179.Pp 180An indirect way to secure the root account is to secure your staff accounts 181by using an alternative login access method and *'ing out the crypted password 182for the staff accounts. This way an intruder may be able to steal the password 183file but will not be able to break into any staff accounts (or, indirectly, 184root, even if root has a crypted password associated with it). Staff members 185get into their staff accounts through a secure login mechanism such as 186.Xr kerberos 1 187or 188.Xr ssh 1 189using a private/public 190key pair. When you use something like kerberos you generally must secure 191the machines which run the kerberos servers and your desktop workstation. 192When you use a public/private key pair with ssh, you must generally secure 193the machine you are logging in FROM 194(typically your workstation), 195but you can 196also add an additional layer of protection to the key pair by password 197protecting the keypair when you create it with 198.Xr ssh-keygen 1 . 199Being able 200to *-out the passwords for staff accounts also guarantees that staff members 201can only login through secure access methods that you have setup. You can 202thus force all staff members to use secure, encrypted connections for 203all their sessions which closes an important hole used by many intruders: That 204of sniffing the network from an unrelated, less secure machine. 205.Pp 206The more indirect security mechanisms also assume that you are logging in 207from a more restrictive server to a less restrictive server. For example, 208if your main box is running all sorts of servers, your workstation shouldn't 209be running any. In order for your workstation to be reasonably secure 210you should run as few servers as possible, up to and including no servers 211at all, and you should run a password-protected screen blanker. 212Of course, given physical access to 213a workstation an attacker can break any sort of security you put on it. 214This is definitely a problem that you should consider but you should also 215consider the fact that the vast majority of break-ins occur remotely, over 216a network, from people who do not have physical access to your workstation or 217servers. 218.Pp 219Using something like kerberos also gives you the ability to disable or 220change the password for a staff account in one place and have it immediately 221effect all the machine the staff member may have an account on. If a staff 222member's account gets compromised, the ability to instantly change his 223password on all machines should not be underrated. With discrete passwords, 224changing a password on N machines can be a mess. You can also impose 225re-passwording restrictions with kerberos: not only can a kerberos ticket 226be made to timeout after a while, but the kerberos system can require that 227the user choose a new password after a certain period of time 228(say, once a month). 229.Sh SECURING ROOT - ROOT-RUN SERVERS AND SUID/SGID BINARIES 230The prudent sysadmin only runs the servers he needs to, no more, no less. Be 231aware that third party servers are often the most bug-prone. For example, 232running an old version of imapd or popper is like giving a universal root 233ticket out to the entire world. Never run a server that you have not checked 234out carefully. Many servers do not need to be run as root. For example, 235the ntalk, comsat, and finger daemons can be run in special user 236.Sq sandboxes . 237A sandbox isn't perfect unless you go to a large amount of trouble, but the 238onion approach to security still stands: If someone is able to break in 239through a server running in a sandbox, they still have to break out of the 240sandbox. The more layers the attacker must break through, the lower the 241likelihood of his success. Root holes have historically been found in 242virtually every server ever run as root, including basic system servers. 243If you are running a machine through which people only login via sshd and 244never login via telnetd or rshd or rlogind, then turn off those services! 245.Pp 246.Fx 247now defaults to running ntalkd, comsat, and finger in a sandbox. 248Another program which may be a candidate for running in a sandbox is 249.Xr named 8 . 250The default rc.conf includes the arguments necessary to run 251named in a sandbox in a commented-out form. Depending on whether you 252are installing a new system or upgrading an existing system, the special 253user accounts used by these sandboxes may not be installed. The prudent 254sysadmin would research and implement sandboxes for servers whenever possible. 255.Pp 256There are a number of other servers that typically do not run in sandboxes: 257sendmail, popper, imapd, ftpd, and others. There are alternatives to 258some of these, but installing them may require more work then you are willing 259to put 260(the convenience factor strikes again). 261You may have to run these 262servers as root and rely on other mechanisms to detect break-ins that might 263occur through them. 264.Pp 265The other big potential root hole in a system are the suid-root and sgid 266binaries installed on the system. Most of these binaries, such as rlogin, 267reside in 268.Pa /bin , 269.Pa /sbin , 270.Pa /usr/bin , 271or 272.Pa /usr/sbin . 273While nothing is 100% safe, 274the system-default suid and sgid binaries can be considered reasonably safe. 275Still, root holes are occasionally found in these binaries. A root hole 276was found in Xlib in 1998 that made xterm 277(which is typically suid) 278vulnerable. 279It is better to be safe than sorry and the prudent sysadmin will restrict suid 280binaries that only staff should run to a special group that only staff can 281access, and get rid of 282.Pq Li "chmod 000" 283any suid binaries that nobody uses. A 284server with no display generally does not need an xterm binary. Sgid binaries 285can be almost as dangerous. If an intruder can break an sgid-kmem binary the 286intruder might be able to read 287.Pa /dev/kmem 288and thus read the crypted password 289file, potentially compromising any passworded account. Alternatively an 290intruder who breaks group kmem can monitor keystrokes sent through pty's, 291including pty's used by users who login through secure methods. An intruder 292that breaks the tty group can write to almost any user's tty. If a user 293is running a terminal 294program or emulator with a keyboard-simulation feature, the intruder can 295potentially 296generate a data stream that causes the user's terminal to echo a command, which 297is then run as that user. 298.Sh SECURING USER ACCOUNTS 299User accounts are usually the most difficult to secure. While you can impose 300Draconian access restrictions on your staff and *-out their passwords, you 301may not be able to do so with any general user accounts you might have. If 302you do have sufficient control then you may win out and be able to secure the 303user accounts properly. If not, you simply have to be more vigilant in your 304monitoring of those accounts. Use of ssh and kerberos for user accounts is 305more problematic due to the extra administration and technical support 306required, but still a very good solution compared to a crypted password 307file. 308.Sh SECURING THE PASSWORD FILE 309The only sure fire way is to *-out as many passwords as you can and 310use ssh or kerberos for access to those accounts. Even though the 311crypted password file 312.Pq Pa /etc/spwd.db 313can only be read by root, it may 314be possible for an intruder to obtain read access to that file even if the 315attacker cannot obtain root-write access. 316.Pp 317Your security scripts should always check for and report changes to 318the password file 319(see 320.Sq Checking file integrity 321below). 322.Sh SECURING THE KERNEL CORE, RAW DEVICES, AND FILE SYSTEMS 323If an attacker breaks root he can do just about anything, but there 324are certain conveniences. For example, most modern kernels have a 325packet sniffing device driver built in. Under 326.Fx 327it is called 328the 329.Sq bpf 330device. An intruder will commonly attempt to run a packet sniffer 331on a compromised machine. You do not need to give the intruder the 332capability and most systems should not have the bpf device compiled in. 333.Pp 334But even if you turn off the bpf device, 335you still have 336.Pa /dev/mem 337and 338.Pa /dev/kmem 339to worry about. For that matter, 340the intruder can still write to raw disk devices. 341Also, there is another kernel feature called the module loader, 342.Xr kldload 8 . 343An enterprising intruder can use a KLD module to install 344his own bpf device or other sniffing device on a running kernel. 345To avoid these problems you have to run 346the kernel at a higher secure level, at least securelevel 1. The securelevel 347can be set with a sysctl on the kern.securelevel variable. Once you have 348set the securelevel to 1, write access to raw devices will be denied and 349special chflags flags, such as 350.Sq schg , 351will be enforced. You must also ensure 352that the 353.Sq schg 354flag is set on critical startup binaries, directories, and 355script files - everything that gets run up to the point where the securelevel 356is set. This might be overdoing it, and upgrading the system is much more 357difficult when you operate at a higher secure level. You may compromise and 358run the system at a higher secure level but not set the schg flag for every 359system file and directory under the sun. Another possibility is to simply 360mount / and /usr read-only. It should be noted that being too draconian in 361what you attempt to protect may prevent the all-important detection of an 362intrusion. 363.Sh CHECKING FILE INTEGRITY: BINARIES, CONFIG FILES, ETC 364When it comes right down to it, you can only protect your core system 365configuration and control files so much before the convenience factor 366rears its ugly head. For example, using chflags to set the schg bit 367on most of the files in / and /usr is probably counterproductive because 368while it may protect the files, it also closes a detection window. The 369last layer of your security onion is perhaps the most important - detection. 370The rest of your security is pretty much useless (or, worse, presents you with 371a false sense of safety) if you cannot detect potential incursions. Half 372the job of the onion is to slow down the attacker rather than stop him 373in order to give the detection side of the equation a chance to catch him in 374the act. 375.Pp 376The best way to detect an incursion is to look for modified, missing, or 377unexpected files. The best 378way to look for modified files is from another (often centralized) 379limited-access system. 380Writing your security scripts on the extra-secure limited-access system 381makes them mostly invisible to potential hackers, and this is important. 382In order to take maximum advantage you generally have to give the 383limited-access box significant access to the other machines in the business, 384usually either by doing a read-only NFS export of the other machines to the 385limited-access box, or by setting up ssh keypairs to allow the limit-access 386box to ssh to the other machines. Except for its network traffic, NFS is 387the least visible method - allowing you to monitor the file systems on each 388client box virtually undetected. If your 389limited-access server is connected to the client boxes through a switch, 390the NFS method is often the better choice. If your limited-access server 391is connected to the client boxes through a hub or through several layers 392of routing, the NFS method may be too insecure (network-wise) and using ssh 393may be the better choice even with the audit-trail tracks that ssh lays. 394.Pp 395Once you give a limit-access box at least read access to the client systems 396it is supposed to monitor, you must write scripts to do the actual 397monitoring. Given an NFS mount, you can write scripts out of simple system 398utilities such as 399.Xr find 1 400and 401.Xr md5 1 402It is best to physically md5 the client-box files boxes at least once a 403day, and to test control files such as those found in 404.Pa /etc 405and 406.Pa /usr/local/etc 407even more often. When mismatches are found relative to the base md5 408information the limited-access machine knows is valid, it should scream at 409a sysadmin to go check it out. A good security script will also check for 410inappropriate suid binaries and for new or deleted files on system partitions 411such as 412.Pa / 413and 414.Pa /usr 415.Pp 416When using ssh rather than NFS, writing the security script is much more 417difficult. You essentially have to 418.Pa scp 419the scripts to the client box in order to run them, making them visible, and 420for safety you also need to scp the binaries (such as find) that those scripts 421use. The ssh daemon on the client box may already be compromised. All in all, 422using ssh may be necessary when running over unsecure links, but it's also a 423lot harder to deal with. 424.Pp 425A good security script will also check for changes to user and staff members 426access configuration files: 427.Pa .rhosts , 428.Pa .shosts , 429.Pa .ssh/authorized_keys 430and so forth... files that might fall outside the purview of the MD5 check. 431.Pp 432If you have a huge amount of user disk space it may take too long to run 433through every file on those partitions. In this case, setting mount 434flags to disallow suid binaries and devices on those partitions is a good 435idea. The 436.Sq nodev 437and 438.Sq nosuid 439options 440(see 441.Xr mount 8 ) 442are what you want to look into. I would scan them anyway at least once a 443week, since the object of this layer is to detect a break-in whether or 444not the breakin is effective. 445.Pp 446Process accounting 447(see 448.Xr accton 8 ) 449is a relatively low-overhead feature of 450the operating system which I recommend using as a post-break-in evaluation 451mechanism. It is especially useful in tracking down how an intruder has 452actually broken into a system, assuming the file is still intact after 453the break-in occurs. 454.Pp 455Finally, security scripts should process the log files and the logs themselves 456should be generated in as secure a manner as possible - remote syslog can be 457very useful. An intruder tries to cover his tracks, and log files are critical 458to the sysadmin trying to track down the time and method of the initial 459break-in. One way to keep a permanent record of the log files is to run 460the system console to a serial port and collect the information on a 461continuing basis through a secure machine monitoring the consoles. 462.Sh PARANOIA 463A little paranoia never hurts. As a rule, a sysadmin can add any number 464of security features as long as they do not effect convenience, and 465can add security features that do effect convenience with some added 466thought. Even more importantly, a security administrator should mix it up 467a bit - if you use recommendations such as those given by this manual 468page verbatim, you give away your methodologies to the prospective 469hacker who also has access to this manual page. 470.Sh SPECIAL SECTION ON D.O.S. ATTACKS 471This section covers Denial of Service attacks. A DOS attack is typically 472a packet attack. While there isn't much you can do about modern spoofed 473packet attacks that saturate your network, you can generally limit the damage 474by ensuring that the attacks cannot take down your servers. 475.Bl -enum -offset indent 476.It 477Limiting server forks 478.It 479Limiting springboard attacks (ICMP response attacks, ping broadcast, etc...) 480.It 481Kernel Route Cache 482.El 483.Pp 484A common DOS attack is against a forking server that attempts to cause the 485server to eat processes, file descriptors, and memory until the machine 486dies. Inetd 487(see 488.Xr inetd 8 ) 489has several options to limit this sort of attack. 490It should be noted that while it is possible to prevent a machine from going 491down it is not generally possible to prevent a service from being disrupted 492by the attack. Read the inetd manual page carefully and pay specific attention 493to the 494.Fl c , 495.Fl C , 496and 497.Fl R 498options. Note that spoofed-IP attacks will circumvent 499the 500.Fl C 501option to inetd, so typically a combination of options must be used. 502Some standalone servers have self-fork-limitation parameters. 503.Pp 504Sendmail has its 505.Fl OMaxDaemonChildren 506option which tends to work much 507better than trying to use sendmail's load limiting options due to the 508load lag. You should specify a 509.Cm MaxDaemonChildren 510parameter when you start 511sendmail high enough to handle your expected load but no so high that the 512computer cannot handle that number of sendmails without falling on its face. 513It is also prudent to run sendmail in queued mode 514.Pq Fl ODeliveryMode=queued 515and to run the daemon 516.Pq Cm sendmail -bd 517separate from the queue-runs 518.Pq Cm sendmail -q15m . 519If you still want realtime delivery you can run the queue 520at a much lower interval, such as 521.Fl q1m , 522but be sure to specify a reasonable 523.Cm MaxDaemonChildren 524option for that sendmail to prevent cascade failures. 525.Pp 526Syslogd can be attacked directly and it is strongly recommended that you use 527the 528.Fl s 529option whenever possible, and the 530.Fl a 531option otherwise. 532.Pp 533You should also be fairly careful 534with connect-back services such as tcpwrapper's reverse-identd, which can 535be attacked directly. You generally do not want to use the reverse-ident 536feature of tcpwrappers for this reason. 537.Pp 538It is a very good idea to protect internal services from external access 539by firewalling them off at your border routers. The idea here is to prevent 540saturation attacks from outside your LAN, not so much to protect internal 541services from network-based root compromise. Always configure an exclusive 542firewall, i.e.\& 543.So 544firewall everything *except* ports A, B, C, D, and M-Z 545.Sc . 546This 547way you can firewall off all of your low ports except for certain specific 548services such as named 549(if you are primary for a zone), 550ntalkd, sendmail, 551and other internet-accessible services. 552If you try to configure the firewall the other 553way - as an inclusive or permissive firewall, there is a good chance that you 554will forget to 555.Sq close 556a couple of services or that you will add a new internal 557service and forget to update the firewall. You can still open up the 558high-numbered port range on the firewall to allow permissive-like operation 559without compromising your low ports. Also take note that 560.Fx 561allows you to 562control the range of port numbers used for dynamic binding via the various 563net.inet.ip.portrange sysctl's 564.Pq Li "sysctl -a | fgrep portrange" , 565which can also 566ease the complexity of your firewall's configuration. I usually use a normal 567first/last range of 4000 to 5000, and a hiport range of 49152 to 65535, then 568block everything under 4000 off in my firewall 569(except for certain specific 570internet-accessible ports, of course). 571.Pp 572Another common DOS attack is called a springboard attack - to attack a server 573in a manner that causes the server to generate responses which then overload 574the server, the local network, or some other machine. The most common attack 575of this nature is the ICMP PING BROADCAST attack. The attacker spoofs ping 576packets sent to your LAN's broadcast address with the source IP address set 577to the actual machine they wish to attack. If your border routers are not 578configured to stomp on ping's to broadcast addresses, your LAN winds up 579generating sufficient responses to the spoofed source address to saturate the 580victim, especially when the attacker uses the same trick on several dozen 581broadcast addresses over several dozen different networks at once. Broadcast 582attacks of over a hundred and twenty megabits have been measured. A second 583common springboard attack is against the ICMP error reporting system. By 584constructing packets that generate ICMP error responses, an attacker can 585saturate a server's incoming network and cause the server to saturate its 586outgoing network with ICMP responses. This type of attack can also crash the 587server by running it out of mbuf's, especially if the server cannot drain the 588ICMP responses it generates fast enough. The 589.Fx 590kernel has a new kernel 591compile option called ICMP_BANDLIM which limits the effectiveness of these 592sorts of attacks. The last major class of springboard attacks is related to 593certain internal inetd services such as the udp echo service. An attacker 594simply spoofs a UDP packet with the source address being server A's echo port, 595and the destination address being server B's echo port, where server A and B 596are both on your LAN. The two servers then bounce this one packet back and 597forth between each other. The attacker can overload both servers and their 598LANs simply by injecting a few packets in this manner. Similar problems 599exist with the internal chargen port. A competent sysadmin will turn off all 600of these inetd-internal test services. 601.Pp 602Spoofed packet attacks may also be used to overload the kernel route cache. 603Refer to the net.inet.ip.rtexpire, rtminexpire, and rtmaxcache sysctl 604parameters. A spoofed packet attack that uses a random source IP will cause 605the kernel to generate a temporary cached route in the route table, viewable 606with 607.Sq netstat -rna \&| fgrep W3 . 608These routes typically timeout in 1600 609seconds or so. If the kernel detects that the cached route table has gotten 610too big it will dynamically reduce the rtexpire but will never decrease it to 611less than rtminexpire. There are two problems: (1) The kernel does not react 612quickly enough when a lightly loaded server is suddenly attacked, and (2) The 613rtminexpire is not low enough for the kernel to survive a sustained attack. 614If your servers are connected to the internet via a T3 or better it may be 615prudent to manually override both rtexpire and rtminexpire via 616.Xr sysctl 8 . 617Never set either parameter to zero 618(unless you want to crash the machine :-)). 619Setting both parameters to 2 seconds should be sufficient to protect the route 620table from attack. 621.Sh ACCESS ISSUES WITH KERBEROS AND SSH 622There are a few issues with both kerberos and ssh that need to be addressed 623if you intend to use them. Kerberos V is an excellent authentication 624protocol but the kerberized telnet and rlogin suck rocks. There are bugs that 625make them unsuitable for dealing with binary streams. Also, by default 626kerberos does not encrypt a session unless you use the 627.Fl x 628option. Ssh encrypts everything by default. 629.Pp 630Ssh works quite well in every respect except when it is set up to 631forward encryption keys. 632What this means is that if you have a secure workstation holding 633keys that give you access to the rest of the system, and you ssh to an 634unsecure machine, your keys become exposed. The actual keys themselves are 635not exposed, but ssh installs a forwarding port for the duration of your 636login and if a hacker has broken root on the unsecure machine he can utilize 637that port to use your keys to gain access to any other machine that your 638keys unlock. 639.Pp 640We recommend that you use ssh in combination with kerberos whenever possible 641for staff logins. Ssh can be compiled with kerberos support. This reduces 642your reliance on potentially exposable ssh keys while at the same time 643protecting passwords via kerberos. Ssh keys 644should only be used for automated tasks from secure machines (something 645that kerberos is unsuited to). We also recommend that you either turn off 646key-forwarding in the ssh configuration, or that you make use of the 647.Pa "from=IP/DOMAIN" 648option that ssh allows in its 649.Pa authorized_keys 650file to make the key only usable to entities logging in from specific 651machines. 652.Sh SEE ALSO 653.Xr chflags 1 , 654.Xr find 1 , 655.Xr md5 1 , 656.Xr netstat 1 , 657.Xr openssl 1 , 658.Xr ssh 1 , 659.Xr xdm 1 , 660.Xr group 5 , 661.Xr ttys 5 , 662.Xr accton 8 , 663.Xr init 8 , 664.Xr kerberos 8 , 665.Xr sshd 8 , 666.Xr sysctl 8 , 667.Xr syslogd 8 , 668.Xr vipw 8 669.Sh HISTORY 670The 671.Nm 672manual page was originally written by 673.An Matthew Dillon 674and first appeared 675in 676.Fx 3.1 , 677December 1998. 678