summaryrefslogtreecommitdiff
path: root/ssh.1
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-12-24 14:52:13 +1100
committerDamien Miller <djm@mindrot.org>2005-12-24 14:52:13 +1100
commitc93a813802cc2a339bcf1dc41c60878a5b1c0373 (patch)
tree877fcc7632cdfd01990bcf276632fe0fe229e546 /ssh.1
parente9a9b71c6b7927ea0f875cde42dffc1f4b195011 (diff)
- jmc@cvs.openbsd.org 2005/12/20 21:59:43
[ssh.1] merge the sections on protocols 1 and 2 into one section on authentication; feedback djm dtucker ok deraadt markus dtucker
Diffstat (limited to 'ssh.1')
-rw-r--r--ssh.1165
1 files changed, 90 insertions, 75 deletions
diff --git a/ssh.1 b/ssh.1
index 31b614b1d..84bd62eb3 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh.1,v 1.221 2005/12/16 18:14:40 jmc Exp $ 37.\" $OpenBSD: ssh.1,v 1.222 2005/12/20 21:59:43 jmc Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
@@ -613,12 +613,38 @@ Enables trusted X11 forwarding.
613Trusted X11 forwardings are not subjected to the X11 SECURITY extension 613Trusted X11 forwardings are not subjected to the X11 SECURITY extension
614controls. 614controls.
615.El 615.El
616.Ss SSH protocol version 1 616.Sh AUTHENTICATION
617The first authentication method is the 617The OpenSSH SSH client supports OpenSSH protocols 1 and 2.
618.Em rhosts 618Protocol 2 is the default, with
619or 619.Nm
620.Em hosts.equiv 620falling back to protocol 1 if it detects protocol 2 is unsupported.
621method combined with RSA-based host authentication. 621These settings may be altered using the
622.Cm Protocol
623option in
624.Xr ssh_config 5 ,
625or enforced using the
626.Fl 1
627and
628.Fl 2
629options (see above).
630Both protocols support similar authentication methods,
631but protocol 2 is preferred since
632it provides additional mechanisms for confidentiality
633(the traffic is encrypted using AES, 3DES, Blowfish, CAST128, or Arcfour)
634and integrity (hmac-md5, hmac-sha1, hmac-ripemd160).
635Protocol 1 lacks a strong mechanism for ensuring the
636integrity of the connection.
637.Pp
638The methods available for authentication are:
639host-based authentication,
640public key authentication,
641challenge-response authentication,
642and password authentication.
643Authentication methods are tried in the order specified above,
644though protocol 2 has a configuration option to change the default order:
645.Cm PreferredAuthentications .
646.Pp
647Host-based authentication works as follows:
622If the machine the user logs in from is listed in 648If the machine the user logs in from is listed in
623.Pa /etc/hosts.equiv 649.Pa /etc/hosts.equiv
624or 650or
@@ -631,33 +657,42 @@ or
631exist in the user's home directory on the 657exist in the user's home directory on the
632remote machine and contain a line containing the name of the client 658remote machine and contain a line containing the name of the client
633machine and the name of the user on that machine, the user is 659machine and the name of the user on that machine, the user is
634considered for log in. 660considered for login.
635Additionally, if the server can verify the client's 661Additionally, the server
636host key (see 662.Em must
663be able to verify the client's
664host key (see the description of
637.Pa /etc/ssh/ssh_known_hosts 665.Pa /etc/ssh/ssh_known_hosts
638and 666and
639.Pa ~/.ssh/known_hosts 667.Pa ~/.ssh/known_hosts ,
640in the 668below)
641.Sx FILES 669for login to be permitted.
642section), only then is login permitted.
643This authentication method closes security holes due to IP 670This authentication method closes security holes due to IP
644spoofing, DNS spoofing and routing spoofing. 671spoofing, DNS spoofing, and routing spoofing.
645[Note to the administrator: 672[Note to the administrator:
646.Pa /etc/hosts.equiv , 673.Pa /etc/hosts.equiv ,
647.Pa ~/.rhosts , 674.Pa ~/.rhosts ,
648and the rlogin/rsh protocol in general, are inherently insecure and should be 675and the rlogin/rsh protocol in general, are inherently insecure and should be
649disabled if security is desired.] 676disabled if security is desired.]
650.Pp 677.Pp
651As a second authentication method, 678Public key authentication works as follows:
652.Nm 679The scheme is based on public-key cryptography,
653supports RSA based authentication. 680using cryptosystems
654The scheme is based on public-key cryptography: there are cryptosystems 681where encryption and decryption are done using separate keys,
655where encryption and decryption are done using separate keys, and it 682and it is unfeasible to derive the decryption key from the encryption key.
656is not possible to derive the decryption key from the encryption key.
657RSA is one such system.
658The idea is that each user creates a public/private 683The idea is that each user creates a public/private
659key pair for authentication purposes. 684key pair for authentication purposes.
660The server knows the public key, and only the user knows the private key. 685The server knows the public key, and only the user knows the private key.
686.Nm
687implements public key authentication protocol automatically,
688using either the RSA or DSA algorithms.
689Protocol 1 is restricted to using only RSA keys,
690but protocol 2 may use either.
691The
692.Sx HISTORY
693section of
694.Xr ssl 8
695contains a brief discussion of the two algorithms.
661.Pp 696.Pp
662The file 697The file
663.Pa ~/.ssh/authorized_keys 698.Pa ~/.ssh/authorized_keys
@@ -666,84 +701,64 @@ When the user logs in, the
666.Nm 701.Nm
667program tells the server which key pair it would like to use for 702program tells the server which key pair it would like to use for
668authentication. 703authentication.
669The server checks if this key is permitted, and if so, 704The client proves that it has access to the private key
670sends the user (actually the 705and the server checks that the corresponding public key
671.Nm 706is authorized to accept the account.
672program running on behalf of the user) a challenge, a random number,
673encrypted by the user's public key.
674The challenge can only be decrypted using the proper private key.
675The user's client then decrypts the challenge using the private key,
676proving that he/she knows the private key
677but without disclosing it to the server.
678.Pp 707.Pp
679.Nm 708The user creates his/her key pair by running
680implements the RSA authentication protocol automatically.
681The user creates his/her RSA key pair by running
682.Xr ssh-keygen 1 . 709.Xr ssh-keygen 1 .
683This stores the private key in 710This stores the private key in
684.Pa ~/.ssh/identity 711.Pa ~/.ssh/identity
712(protocol 1),
713.Pa ~/.ssh/id_dsa
714(protocol 2 DSA),
715or
716.Pa ~/.ssh/id_rsa
717(protocol 2 RSA)
685and stores the public key in 718and stores the public key in
686.Pa ~/.ssh/identity.pub 719.Pa ~/.ssh/identity.pub
720(protocol 1),
721.Pa ~/.ssh/id_dsa.pub
722(protocol 2 DSA),
723or
724.Pa ~/.ssh/id_rsa.pub
725(protocol 2 RSA)
687in the user's home directory. 726in the user's home directory.
688The user should then copy the 727The user should then copy the public key
689.Pa identity.pub
690to 728to
691.Pa ~/.ssh/authorized_keys 729.Pa ~/.ssh/authorized_keys
692in his/her home directory on the remote machine (the 730in his/her home directory on the remote machine.
731The
693.Pa authorized_keys 732.Pa authorized_keys
694file corresponds to the conventional 733file corresponds to the conventional
695.Pa ~/.rhosts 734.Pa ~/.rhosts
696file, and has one key 735file, and has one key
697per line, though the lines can be very long). 736per line, though the lines can be very long.
698After this, the user can log in without giving the password. 737After this, the user can log in without giving the password.
699.Pp 738.Pp
700The most convenient way to use RSA authentication may be with an 739The most convenient way to use public key authentication may be with an
701authentication agent. 740authentication agent.
702See 741See
703.Xr ssh-agent 1 742.Xr ssh-agent 1
704for more information. 743for more information.
705.Pp 744.Pp
706If other authentication methods fail, 745Challenge-response authentication works as follows:
746The server sends an arbitrary
747.Qq challenge
748text, and prompts for a response.
749Protocol 2 allows multiple challenges and responses;
750protocol 1 is restricted to just one challenge/response.
751Examples of challenge-response authentication include
752BSD Authentication (see
753.Xr login.conf 5 )
754and PAM (some non-OpenBSD systems).
755.Pp
756Finally, if other authentication methods fail,
707.Nm 757.Nm
708prompts the user for a password. 758prompts the user for a password.
709The password is sent to the remote 759The password is sent to the remote
710host for checking; however, since all communications are encrypted, 760host for checking; however, since all communications are encrypted,
711the password cannot be seen by someone listening on the network. 761the password cannot be seen by someone listening on the network.
712.Ss SSH protocol version 2
713When a user connects using protocol version 2,
714similar authentication methods are available.
715Using the default values for
716.Cm PreferredAuthentications ,
717the client will try to authenticate first using the hostbased method;
718if this method fails, public key authentication is attempted,
719and finally if this method fails, keyboard-interactive and
720password authentication are tried.
721.Pp
722The public key method is similar to RSA authentication described
723in the previous section and allows the RSA or DSA algorithm to be used:
724The client uses his private key,
725.Pa ~/.ssh/id_dsa
726or
727.Pa ~/.ssh/id_rsa ,
728to sign the session identifier and sends the result to the server.
729The server checks whether the matching public key is listed in
730.Pa ~/.ssh/authorized_keys
731and grants access if both the key is found and the signature is correct.
732The session identifier is derived from a shared Diffie-Hellman value
733and is only known to the client and the server.
734.Pp
735If public key authentication fails or is not available, a password
736can be sent encrypted to the remote host to prove the user's identity.
737.Pp
738Additionally,
739.Nm
740supports hostbased or challenge response authentication.
741.Pp
742Protocol 2 provides additional mechanisms for confidentiality
743(the traffic is encrypted using AES, 3DES, Blowfish, CAST128 or Arcfour)
744and integrity (hmac-md5, hmac-sha1, hmac-ripemd160).
745Note that protocol 1 lacks a strong mechanism for ensuring the
746integrity of the connection.
747.Ss Login session and remote execution 762.Ss Login session and remote execution
748When the user's identity has been accepted by the server, the server 763When the user's identity has been accepted by the server, the server
749either executes the given command, or logs into the machine and gives 764either executes the given command, or logs into the machine and gives