summaryrefslogtreecommitdiff
path: root/ssh.1
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-12-20 16:09:36 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-12-20 16:09:36 +1100
commitd3877b995ac0e1245c70e520cc986aac99c901be (patch)
tree37ec5f7966bb3f28282c9246884a956e1ff84028 /ssh.1
parent0d0e8f0173bd10a8a2325fbb3ef83e04a91abdcc (diff)
- jmc@cvs.openbsd.org 2005/12/16 18:07:08
[ssh.1] move the option descriptions up the page: start of a restructure; ok markus deraadt
Diffstat (limited to 'ssh.1')
-rw-r--r--ssh.1600
1 files changed, 300 insertions, 300 deletions
diff --git a/ssh.1 b/ssh.1
index 9f89b9730..c50bc1526 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.217 2005/12/08 14:59:44 jmc Exp $ 37.\" $OpenBSD: ssh.1,v 1.218 2005/12/16 18:07:08 jmc Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
@@ -107,304 +107,6 @@ If
107is specified, 107is specified,
108.Ar command 108.Ar command
109is executed on the remote host instead of a login shell. 109is executed on the remote host instead of a login shell.
110.Ss SSH protocol version 1
111The first authentication method is the
112.Em rhosts
113or
114.Em hosts.equiv
115method combined with RSA-based host authentication.
116If the machine the user logs in from is listed in
117.Pa /etc/hosts.equiv
118or
119.Pa /etc/shosts.equiv
120on the remote machine, and the user names are
121the same on both sides, or if the files
122.Pa ~/.rhosts
123or
124.Pa ~/.shosts
125exist in the user's home directory on the
126remote machine and contain a line containing the name of the client
127machine and the name of the user on that machine, the user is
128considered for log in.
129Additionally, if the server can verify the client's
130host key (see
131.Pa /etc/ssh/ssh_known_hosts
132and
133.Pa ~/.ssh/known_hosts
134in the
135.Sx FILES
136section), only then is login permitted.
137This authentication method closes security holes due to IP
138spoofing, DNS spoofing and routing spoofing.
139[Note to the administrator:
140.Pa /etc/hosts.equiv ,
141.Pa ~/.rhosts ,
142and the rlogin/rsh protocol in general, are inherently insecure and should be
143disabled if security is desired.]
144.Pp
145As a second authentication method,
146.Nm
147supports RSA based authentication.
148The scheme is based on public-key cryptography: there are cryptosystems
149where encryption and decryption are done using separate keys, and it
150is not possible to derive the decryption key from the encryption key.
151RSA is one such system.
152The idea is that each user creates a public/private
153key pair for authentication purposes.
154The server knows the public key, and only the user knows the private key.
155.Pp
156The file
157.Pa ~/.ssh/authorized_keys
158lists the public keys that are permitted for logging in.
159When the user logs in, the
160.Nm
161program tells the server which key pair it would like to use for
162authentication.
163The server checks if this key is permitted, and if so,
164sends the user (actually the
165.Nm
166program running on behalf of the user) a challenge, a random number,
167encrypted by the user's public key.
168The challenge can only be decrypted using the proper private key.
169The user's client then decrypts the challenge using the private key,
170proving that he/she knows the private key
171but without disclosing it to the server.
172.Pp
173.Nm
174implements the RSA authentication protocol automatically.
175The user creates his/her RSA key pair by running
176.Xr ssh-keygen 1 .
177This stores the private key in
178.Pa ~/.ssh/identity
179and stores the public key in
180.Pa ~/.ssh/identity.pub
181in the user's home directory.
182The user should then copy the
183.Pa identity.pub
184to
185.Pa ~/.ssh/authorized_keys
186in his/her home directory on the remote machine (the
187.Pa authorized_keys
188file corresponds to the conventional
189.Pa ~/.rhosts
190file, and has one key
191per line, though the lines can be very long).
192After this, the user can log in without giving the password.
193.Pp
194The most convenient way to use RSA authentication may be with an
195authentication agent.
196See
197.Xr ssh-agent 1
198for more information.
199.Pp
200If other authentication methods fail,
201.Nm
202prompts the user for a password.
203The password is sent to the remote
204host for checking; however, since all communications are encrypted,
205the password cannot be seen by someone listening on the network.
206.Ss SSH protocol version 2
207When a user connects using protocol version 2,
208similar authentication methods are available.
209Using the default values for
210.Cm PreferredAuthentications ,
211the client will try to authenticate first using the hostbased method;
212if this method fails, public key authentication is attempted,
213and finally if this method fails, keyboard-interactive and
214password authentication are tried.
215.Pp
216The public key method is similar to RSA authentication described
217in the previous section and allows the RSA or DSA algorithm to be used:
218The client uses his private key,
219.Pa ~/.ssh/id_dsa
220or
221.Pa ~/.ssh/id_rsa ,
222to sign the session identifier and sends the result to the server.
223The server checks whether the matching public key is listed in
224.Pa ~/.ssh/authorized_keys
225and grants access if both the key is found and the signature is correct.
226The session identifier is derived from a shared Diffie-Hellman value
227and is only known to the client and the server.
228.Pp
229If public key authentication fails or is not available, a password
230can be sent encrypted to the remote host to prove the user's identity.
231.Pp
232Additionally,
233.Nm
234supports hostbased or challenge response authentication.
235.Pp
236Protocol 2 provides additional mechanisms for confidentiality
237(the traffic is encrypted using AES, 3DES, Blowfish, CAST128 or Arcfour)
238and integrity (hmac-md5, hmac-sha1, hmac-ripemd160).
239Note that protocol 1 lacks a strong mechanism for ensuring the
240integrity of the connection.
241.Ss Login session and remote execution
242When the user's identity has been accepted by the server, the server
243either executes the given command, or logs into the machine and gives
244the user a normal shell on the remote machine.
245All communication with
246the remote command or shell will be automatically encrypted.
247.Pp
248If a pseudo-terminal has been allocated (normal login session), the
249user may use the escape characters noted below.
250.Pp
251If no pseudo-tty has been allocated,
252the session is transparent and can be used to reliably transfer binary data.
253On most systems, setting the escape character to
254.Dq none
255will also make the session transparent even if a tty is used.
256.Pp
257The session terminates when the command or shell on the remote
258machine exits and all X11 and TCP/IP connections have been closed.
259The exit status of the remote program is returned as the exit status of
260.Nm ssh .
261.Ss Escape Characters
262When a pseudo-terminal has been requested,
263.Nm
264supports a number of functions through the use of an escape character.
265.Pp
266A single tilde character can be sent as
267.Ic ~~
268or by following the tilde by a character other than those described below.
269The escape character must always follow a newline to be interpreted as
270special.
271The escape character can be changed in configuration files using the
272.Cm EscapeChar
273configuration directive or on the command line by the
274.Fl e
275option.
276.Pp
277The supported escapes (assuming the default
278.Ql ~ )
279are:
280.Bl -tag -width Ds
281.It Cm ~.
282Disconnect.
283.It Cm ~^Z
284Background
285.Nm ssh .
286.It Cm ~#
287List forwarded connections.
288.It Cm ~&
289Background
290.Nm
291at logout when waiting for forwarded connection / X11 sessions to terminate.
292.It Cm ~?
293Display a list of escape characters.
294.It Cm ~B
295Send a BREAK to the remote system
296(only useful for SSH protocol version 2 and if the peer supports it).
297.It Cm ~C
298Open command line.
299Currently this allows the addition of port forwardings using the
300.Fl L
301and
302.Fl R
303options (see below).
304It also allows the cancellation of existing remote port-forwardings
305using
306.Fl KR Ar hostport .
307.Ic !\& Ns Ar command
308allows the user to execute a local command if the
309.Ic PermitLocalCommand
310option is enabled in
311.Xr ssh_config 5 .
312Basic help is available, using the
313.Fl h
314option.
315.It Cm ~R
316Request rekeying of the connection
317(only useful for SSH protocol version 2 and if the peer supports it).
318.El
319.Ss X11 and TCP forwarding
320If the
321.Cm ForwardX11
322variable is set to
323.Dq yes
324(or see the description of the
325.Fl X
326and
327.Fl x
328options described later)
329and the user is using X11 (the
330.Ev DISPLAY
331environment variable is set), the connection to the X11 display is
332automatically forwarded to the remote side in such a way that any X11
333programs started from the shell (or command) will go through the
334encrypted channel, and the connection to the real X server will be made
335from the local machine.
336The user should not manually set
337.Ev DISPLAY .
338Forwarding of X11 connections can be
339configured on the command line or in configuration files.
340.Pp
341The
342.Ev DISPLAY
343value set by
344.Nm
345will point to the server machine, but with a display number greater than zero.
346This is normal, and happens because
347.Nm
348creates a
349.Dq proxy
350X server on the server machine for forwarding the
351connections over the encrypted channel.
352.Pp
353.Nm
354will also automatically set up Xauthority data on the server machine.
355For this purpose, it will generate a random authorization cookie,
356store it in Xauthority on the server, and verify that any forwarded
357connections carry this cookie and replace it by the real cookie when
358the connection is opened.
359The real authentication cookie is never
360sent to the server machine (and no cookies are sent in the plain).
361.Pp
362If the
363.Cm ForwardAgent
364variable is set to
365.Dq yes
366(or see the description of the
367.Fl A
368and
369.Fl a
370options described later) and
371the user is using an authentication agent, the connection to the agent
372is automatically forwarded to the remote side.
373.Pp
374Forwarding of arbitrary TCP/IP connections over the secure channel can
375be specified either on the command line or in a configuration file.
376One possible application of TCP/IP forwarding is a secure connection to an
377electronic purse; another is going through firewalls.
378.Ss Server authentication
379.Nm
380automatically maintains and checks a database containing
381identifications for all hosts it has ever been used with.
382Host keys are stored in
383.Pa ~/.ssh/known_hosts
384in the user's home directory.
385Additionally, the file
386.Pa /etc/ssh/ssh_known_hosts
387is automatically checked for known hosts.
388Any new hosts are automatically added to the user's file.
389If a host's identification ever changes,
390.Nm
391warns about this and disables password authentication to prevent a
392trojan horse from getting the user's password.
393Another purpose of this mechanism is to prevent man-in-the-middle attacks
394which could otherwise be used to circumvent the encryption.
395The
396.Cm StrictHostKeyChecking
397option can be used to prevent logins to machines whose
398host key is not known or has changed.
399.Pp
400.Nm
401can be configured to verify host identification using fingerprint resource
402records (SSHFP) published in DNS.
403The
404.Cm VerifyHostKeyDNS
405option can be used to control how DNS lookups are performed.
406SSHFP resource records can be generated using
407.Xr ssh-keygen 1 .
408.Pp 110.Pp
409The options are as follows: 111The options are as follows:
410.Bl -tag -width Ds 112.Bl -tag -width Ds
@@ -912,12 +614,310 @@ Enables trusted X11 forwarding.
912Trusted X11 forwardings are not subjected to the X11 SECURITY extension 614Trusted X11 forwardings are not subjected to the X11 SECURITY extension
913controls. 615controls.
914.El 616.El
915.Sh CONFIGURATION FILES 617.Ss SSH protocol version 1
618The first authentication method is the
619.Em rhosts
620or
621.Em hosts.equiv
622method combined with RSA-based host authentication.
623If the machine the user logs in from is listed in
624.Pa /etc/hosts.equiv
625or
626.Pa /etc/shosts.equiv
627on the remote machine, and the user names are
628the same on both sides, or if the files
629.Pa ~/.rhosts
630or
631.Pa ~/.shosts
632exist in the user's home directory on the
633remote machine and contain a line containing the name of the client
634machine and the name of the user on that machine, the user is
635considered for log in.
636Additionally, if the server can verify the client's
637host key (see
638.Pa /etc/ssh/ssh_known_hosts
639and
640.Pa ~/.ssh/known_hosts
641in the
642.Sx FILES
643section), only then is login permitted.
644This authentication method closes security holes due to IP
645spoofing, DNS spoofing and routing spoofing.
646[Note to the administrator:
647.Pa /etc/hosts.equiv ,
648.Pa ~/.rhosts ,
649and the rlogin/rsh protocol in general, are inherently insecure and should be
650disabled if security is desired.]
651.Pp
652As a second authentication method,
653.Nm
654supports RSA based authentication.
655The scheme is based on public-key cryptography: there are cryptosystems
656where encryption and decryption are done using separate keys, and it
657is not possible to derive the decryption key from the encryption key.
658RSA is one such system.
659The idea is that each user creates a public/private
660key pair for authentication purposes.
661The server knows the public key, and only the user knows the private key.
662.Pp
663The file
664.Pa ~/.ssh/authorized_keys
665lists the public keys that are permitted for logging in.
666When the user logs in, the
667.Nm
668program tells the server which key pair it would like to use for
669authentication.
670The server checks if this key is permitted, and if so,
671sends the user (actually the
672.Nm
673program running on behalf of the user) a challenge, a random number,
674encrypted by the user's public key.
675The challenge can only be decrypted using the proper private key.
676The user's client then decrypts the challenge using the private key,
677proving that he/she knows the private key
678but without disclosing it to the server.
679.Pp
680.Nm
681implements the RSA authentication protocol automatically.
682The user creates his/her RSA key pair by running
683.Xr ssh-keygen 1 .
684This stores the private key in
685.Pa ~/.ssh/identity
686and stores the public key in
687.Pa ~/.ssh/identity.pub
688in the user's home directory.
689The user should then copy the
690.Pa identity.pub
691to
692.Pa ~/.ssh/authorized_keys
693in his/her home directory on the remote machine (the
694.Pa authorized_keys
695file corresponds to the conventional
696.Pa ~/.rhosts
697file, and has one key
698per line, though the lines can be very long).
699After this, the user can log in without giving the password.
700.Pp
701The most convenient way to use RSA authentication may be with an
702authentication agent.
703See
704.Xr ssh-agent 1
705for more information.
706.Pp
707If other authentication methods fail,
708.Nm
709prompts the user for a password.
710The password is sent to the remote
711host for checking; however, since all communications are encrypted,
712the password cannot be seen by someone listening on the network.
713.Ss SSH protocol version 2
714When a user connects using protocol version 2,
715similar authentication methods are available.
716Using the default values for
717.Cm PreferredAuthentications ,
718the client will try to authenticate first using the hostbased method;
719if this method fails, public key authentication is attempted,
720and finally if this method fails, keyboard-interactive and
721password authentication are tried.
722.Pp
723The public key method is similar to RSA authentication described
724in the previous section and allows the RSA or DSA algorithm to be used:
725The client uses his private key,
726.Pa ~/.ssh/id_dsa
727or
728.Pa ~/.ssh/id_rsa ,
729to sign the session identifier and sends the result to the server.
730The server checks whether the matching public key is listed in
731.Pa ~/.ssh/authorized_keys
732and grants access if both the key is found and the signature is correct.
733The session identifier is derived from a shared Diffie-Hellman value
734and is only known to the client and the server.
735.Pp
736If public key authentication fails or is not available, a password
737can be sent encrypted to the remote host to prove the user's identity.
738.Pp
739Additionally,
740.Nm
741supports hostbased or challenge response authentication.
742.Pp
743Protocol 2 provides additional mechanisms for confidentiality
744(the traffic is encrypted using AES, 3DES, Blowfish, CAST128 or Arcfour)
745and integrity (hmac-md5, hmac-sha1, hmac-ripemd160).
746Note that protocol 1 lacks a strong mechanism for ensuring the
747integrity of the connection.
748.Ss Login session and remote execution
749When the user's identity has been accepted by the server, the server
750either executes the given command, or logs into the machine and gives
751the user a normal shell on the remote machine.
752All communication with
753the remote command or shell will be automatically encrypted.
754.Pp
755If a pseudo-terminal has been allocated (normal login session), the
756user may use the escape characters noted below.
757.Pp
758If no pseudo-tty has been allocated,
759the session is transparent and can be used to reliably transfer binary data.
760On most systems, setting the escape character to
761.Dq none
762will also make the session transparent even if a tty is used.
763.Pp
764The session terminates when the command or shell on the remote
765machine exits and all X11 and TCP/IP connections have been closed.
766The exit status of the remote program is returned as the exit status of
767.Nm ssh .
768.Pp
916.Nm 769.Nm
917may additionally obtain configuration data from 770may additionally obtain configuration data from
918a per-user configuration file and a system-wide configuration file. 771a per-user configuration file and a system-wide configuration file.
919The file format and configuration options are described in 772The file format and configuration options are described in
920.Xr ssh_config 5 . 773.Xr ssh_config 5 .
774.Ss Escape Characters
775When a pseudo-terminal has been requested,
776.Nm
777supports a number of functions through the use of an escape character.
778.Pp
779A single tilde character can be sent as
780.Ic ~~
781or by following the tilde by a character other than those described below.
782The escape character must always follow a newline to be interpreted as
783special.
784The escape character can be changed in configuration files using the
785.Cm EscapeChar
786configuration directive or on the command line by the
787.Fl e
788option.
789.Pp
790The supported escapes (assuming the default
791.Ql ~ )
792are:
793.Bl -tag -width Ds
794.It Cm ~.
795Disconnect.
796.It Cm ~^Z
797Background
798.Nm ssh .
799.It Cm ~#
800List forwarded connections.
801.It Cm ~&
802Background
803.Nm
804at logout when waiting for forwarded connection / X11 sessions to terminate.
805.It Cm ~?
806Display a list of escape characters.
807.It Cm ~B
808Send a BREAK to the remote system
809(only useful for SSH protocol version 2 and if the peer supports it).
810.It Cm ~C
811Open command line.
812Currently this allows the addition of port forwardings using the
813.Fl L
814and
815.Fl R
816options (see below).
817It also allows the cancellation of existing remote port-forwardings
818using
819.Fl KR Ar hostport .
820.Ic !\& Ns Ar command
821allows the user to execute a local command if the
822.Ic PermitLocalCommand
823option is enabled in
824.Xr ssh_config 5 .
825Basic help is available, using the
826.Fl h
827option.
828.It Cm ~R
829Request rekeying of the connection
830(only useful for SSH protocol version 2 and if the peer supports it).
831.El
832.Ss X11 and TCP forwarding
833If the
834.Cm ForwardX11
835variable is set to
836.Dq yes
837(or see the description of the
838.Fl X
839and
840.Fl x
841options described later)
842and the user is using X11 (the
843.Ev DISPLAY
844environment variable is set), the connection to the X11 display is
845automatically forwarded to the remote side in such a way that any X11
846programs started from the shell (or command) will go through the
847encrypted channel, and the connection to the real X server will be made
848from the local machine.
849The user should not manually set
850.Ev DISPLAY .
851Forwarding of X11 connections can be
852configured on the command line or in configuration files.
853.Pp
854The
855.Ev DISPLAY
856value set by
857.Nm
858will point to the server machine, but with a display number greater than zero.
859This is normal, and happens because
860.Nm
861creates a
862.Dq proxy
863X server on the server machine for forwarding the
864connections over the encrypted channel.
865.Pp
866.Nm
867will also automatically set up Xauthority data on the server machine.
868For this purpose, it will generate a random authorization cookie,
869store it in Xauthority on the server, and verify that any forwarded
870connections carry this cookie and replace it by the real cookie when
871the connection is opened.
872The real authentication cookie is never
873sent to the server machine (and no cookies are sent in the plain).
874.Pp
875If the
876.Cm ForwardAgent
877variable is set to
878.Dq yes
879(or see the description of the
880.Fl A
881and
882.Fl a
883options described later) and
884the user is using an authentication agent, the connection to the agent
885is automatically forwarded to the remote side.
886.Pp
887Forwarding of arbitrary TCP/IP connections over the secure channel can
888be specified either on the command line or in a configuration file.
889One possible application of TCP/IP forwarding is a secure connection to an
890electronic purse; another is going through firewalls.
891.Ss Server authentication
892.Nm
893automatically maintains and checks a database containing
894identifications for all hosts it has ever been used with.
895Host keys are stored in
896.Pa ~/.ssh/known_hosts
897in the user's home directory.
898Additionally, the file
899.Pa /etc/ssh/ssh_known_hosts
900is automatically checked for known hosts.
901Any new hosts are automatically added to the user's file.
902If a host's identification ever changes,
903.Nm
904warns about this and disables password authentication to prevent a
905trojan horse from getting the user's password.
906Another purpose of this mechanism is to prevent man-in-the-middle attacks
907which could otherwise be used to circumvent the encryption.
908The
909.Cm StrictHostKeyChecking
910option can be used to prevent logins to machines whose
911host key is not known or has changed.
912.Pp
913.Nm
914can be configured to verify host identification using fingerprint resource
915records (SSHFP) published in DNS.
916The
917.Cm VerifyHostKeyDNS
918option can be used to control how DNS lookups are performed.
919SSHFP resource records can be generated using
920.Xr ssh-keygen 1 .
921.Sh ENVIRONMENT 921.Sh ENVIRONMENT
922.Nm 922.Nm
923will normally set the following environment variables: 923will normally set the following environment variables: