]> andersk Git - openssh.git/blame - ssh.1
- (djm) Fix server not exiting with jobs in background.
[openssh.git] / ssh.1
CommitLineData
bf740959 1.\" -*- nroff -*-
2.\"
3.\" ssh.1.in
4.\"
5.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
6.\"
7.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8.\" All rights reserved
9.\"
10.\" Created: Sat Apr 22 21:55:14 1995 ylo
11.\"
12.\" $Id$
13.\"
14.Dd September 25, 1999
15.Dt SSH 1
16.Os
17.Sh NAME
18.Nm ssh
19.Nd OpenSSH secure shell client (remote login program)
20.Sh SYNOPSIS
21.Nm ssh
22.Op Fl l Ar login_name
23.Op Ar hostname | user@hostname
24.Op Ar command
25.Pp
26.Nm ssh
71276795 27.Op Fl afgknqtvxACNPTX246
d0c832f3 28.Op Fl c Ar cipher_spec
bf740959 29.Op Fl e Ar escape_char
30.Op Fl i Ar identity_file
31.Op Fl l Ar login_name
32.Op Fl o Ar option
33.Op Fl p Ar port
34.Oo Fl L Xo
35.Sm off
bf740959 36.Ar port :
7b2ea3a1 37.Ar host :
bf740959 38.Ar hostport
39.Sm on
40.Xc
41.Oc
42.Oo Fl R Xo
43.Sm off
bf740959 44.Ar port :
7b2ea3a1 45.Ar host :
bf740959 46.Ar hostport
47.Sm on
48.Xc
49.Oc
50.Op Ar hostname | user@hostname
51.Op Ar command
f54651ce 52.Sh DESCRIPTION
bf740959 53.Nm
54(Secure Shell) is a program for logging into a remote machine and for
610cd5c6 55executing commands on a remote machine.
56It is intended to replace
bf740959 57rlogin and rsh, and provide secure encrypted communications between
610cd5c6 58two untrusted hosts over an insecure network.
59X11 connections and
bf740959 60arbitrary TCP/IP ports can also be forwarded over the secure channel.
61.Pp
62.Nm
f54651ce 63connects and logs into the specified
bf740959 64.Ar hostname .
65The user must prove
1d1ffb87 66his/her identity to the remote machine using one of several methods
67depending on the protocol version used:
68.Pp
69.Ss SSH protocol version 1
bf740959 70.Pp
71First, if the machine the user logs in from is listed in
72.Pa /etc/hosts.equiv
73or
5f4fdfae 74.Pa /etc/shosts.equiv
bf740959 75on the remote machine, and the user names are
76the same on both sides, the user is immediately permitted to log in.
f54651ce 77Second, if
bf740959 78.Pa \&.rhosts
79or
80.Pa \&.shosts
81exists in the user's home directory on the
82remote machine and contains a line containing the name of the client
83machine and the name of the user on that machine, the user is
610cd5c6 84permitted to log in.
85This form of authentication alone is normally not
bf740959 86allowed by the server because it is not secure.
87.Pp
88The second (and primary) authentication method is the
89.Pa rhosts
90or
91.Pa hosts.equiv
610cd5c6 92method combined with RSA-based host authentication.
93It means that if the login would be permitted by
1d1ffb87 94.Pa $HOME/.rhosts ,
95.Pa $HOME/.shosts ,
bf740959 96.Pa /etc/hosts.equiv ,
97or
5f4fdfae 98.Pa /etc/shosts.equiv ,
bf740959 99and if additionally the server can verify the client's
f54651ce 100host key (see
5f4fdfae 101.Pa /etc/ssh_known_hosts
5bbb5681 102and
103.Pa $HOME/.ssh/known_hosts
bf740959 104in the
105.Sx FILES
610cd5c6 106section), only then login is permitted.
107This authentication method closes security holes due to IP
108spoofing, DNS spoofing and routing spoofing.
109[Note to the administrator:
bf740959 110.Pa /etc/hosts.equiv ,
1d1ffb87 111.Pa $HOME/.rhosts ,
bf740959 112and the rlogin/rsh protocol in general, are inherently insecure and should be
113disabled if security is desired.]
114.Pp
f54651ce 115As a third authentication method,
bf740959 116.Nm
117supports RSA based authentication.
118The scheme is based on public-key cryptography: there are cryptosystems
119where encryption and decryption are done using separate keys, and it
120is not possible to derive the decryption key from the encryption key.
610cd5c6 121RSA is one such system.
f54651ce 122The idea is that each user creates a public/private
610cd5c6 123key pair for authentication purposes.
124The server knows the public key, and only the user knows the private key.
f54651ce 125The file
bf740959 126.Pa $HOME/.ssh/authorized_keys
127lists the public keys that are permitted for logging
610cd5c6 128in.
129When the user logs in, the
bf740959 130.Nm
131program tells the server which key pair it would like to use for
610cd5c6 132authentication.
133The server checks if this key is permitted, and if
bf740959 134so, sends the user (actually the
135.Nm
136program running on behalf of the user) a challenge, a random number,
610cd5c6 137encrypted by the user's public key.
138The challenge can only be
139decrypted using the proper private key.
140The user's client then decrypts the
bf740959 141challenge using the private key, proving that he/she knows the private
142key but without disclosing it to the server.
143.Pp
144.Nm
610cd5c6 145implements the RSA authentication protocol automatically.
146The user creates his/her RSA key pair by running
bf740959 147.Xr ssh-keygen 1 .
f54651ce 148This stores the private key in
1d1ffb87 149.Pa $HOME/.ssh/identity
bf740959 150and the public key in
1d1ffb87 151.Pa $HOME/.ssh/identity.pub
610cd5c6 152in the user's home directory.
153The user should then copy the
bf740959 154.Pa identity.pub
f54651ce 155to
1d1ffb87 156.Pa $HOME/.ssh/authorized_keys
f54651ce 157in his/her home directory on the remote machine (the
bf740959 158.Pa authorized_keys
f54651ce 159file corresponds to the conventional
1d1ffb87 160.Pa $HOME/.rhosts
bf740959 161file, and has one key
610cd5c6 162per line, though the lines can be very long).
163After this, the user can log in without giving the password.
164RSA authentication is much
bf740959 165more secure than rhosts authentication.
166.Pp
167The most convenient way to use RSA authentication may be with an
610cd5c6 168authentication agent.
169See
bf740959 170.Xr ssh-agent 1
171for more information.
172.Pp
f54651ce 173If other authentication methods fail,
bf740959 174.Nm
610cd5c6 175prompts the user for a password.
176The password is sent to the remote
bf740959 177host for checking; however, since all communications are encrypted,
178the password cannot be seen by someone listening on the network.
179.Pp
1d1ffb87 180.Ss SSH protocol version 2
181.Pp
182When a user connects using the protocol version 2
183different authentication methods are available:
184At first, the client attempts to authenticate using the public key method.
185If this method fails password authentication is tried.
186.Pp
187The public key method is similar to RSA authentication described
188in the previous section except that the DSA algorithm is used
189instead of the patented RSA algorithm.
190The client uses his private DSA key
191.Pa $HOME/.ssh/id_dsa
192to sign the session identifier and sends the result to the server.
193The server checks whether the matching public key is listed in
194.Pa $HOME/.ssh/authorized_keys2
195and grants access if both the key is found and the signature is correct.
196The session identifier is derived from a shared Diffie-Hellman value
197and is only known to the client and the server.
198.Pp
199If public key authentication fails or is not available a password
200can be sent encrypted to the remote host for proving the user's identity.
201This protocol 2 implementation does not yet support Kerberos or
202S/Key authentication.
203.Pp
204Protocol 2 provides additional mechanisms for confidentiality
d0c832f3 205(the traffic is encrypted using 3DES, Blowfish, CAST128 or Arcfour)
1d1ffb87 206and integrity (hmac-sha1, hmac-md5).
207Note that protocol 1 lacks a strong mechanism for ensuring the
208integrity of the connection.
209.Pp
210.Ss Login session and remote execution
211.Pp
bf740959 212When the user's identity has been accepted by the server, the server
213either executes the given command, or logs into the machine and gives
610cd5c6 214the user a normal shell on the remote machine.
215All communication with
bf740959 216the remote command or shell will be automatically encrypted.
217.Pp
218If a pseudo-terminal has been allocated (normal login session), the
219user can disconnect with
220.Ic ~. ,
221and suspend
222.Nm
223with
224.Ic ~^Z .
225All forwarded connections can be listed with
f54651ce 226.Ic ~#
bf740959 227and if
228the session blocks waiting for forwarded X11 or TCP/IP
229connections to terminate, it can be backgrounded with
230.Ic ~&
231(this should not be used while the user shell is active, as it can cause the
610cd5c6 232shell to hang).
233All available escapes can be listed with
bf740959 234.Ic ~? .
235.Pp
236A single tilde character can be sent as
237.Ic ~~
238(or by following the tilde by a character other than those described above).
239The escape character must always follow a newline to be interpreted as
610cd5c6 240special.
241The escape character can be changed in configuration files
242or on the command line.
bf740959 243.Pp
244If no pseudo tty has been allocated, the
245session is transparent and can be used to reliably transfer binary
610cd5c6 246data.
247On most systems, setting the escape character to
bf740959 248.Dq none
249will also make the session transparent even if a tty is used.
250.Pp
251The session terminates when the command or shell in on the remote
252machine exists and all X11 and TCP/IP connections have been closed.
253The exit status of the remote program is returned as the exit status
254of
255.Nm ssh .
256.Pp
1d1ffb87 257.Ss X11 and TCP forwarding
258.Pp
bf740959 259If the user is using X11 (the
260.Ev DISPLAY
261environment variable is set), the connection to the X11 display is
262automatically forwarded to the remote side in such a way that any X11
263programs started from the shell (or command) will go through the
264encrypted channel, and the connection to the real X server will be made
610cd5c6 265from the local machine.
266The user should not manually set
bf740959 267.Ev DISPLAY .
268Forwarding of X11 connections can be
269configured on the command line or in configuration files.
270.Pp
271The
f54651ce 272.Ev DISPLAY
bf740959 273value set by
274.Nm
275will point to the server machine, but with a display number greater
610cd5c6 276than zero.
277This is normal, and happens because
bf740959 278.Nm
279creates a
280.Dq proxy
281X server on the server machine for forwarding the
282connections over the encrypted channel.
283.Pp
284.Nm
285will also automatically set up Xauthority data on the server machine.
286For this purpose, it will generate a random authorization cookie,
287store it in Xauthority on the server, and verify that any forwarded
288connections carry this cookie and replace it by the real cookie when
610cd5c6 289the connection is opened.
290The real authentication cookie is never
bf740959 291sent to the server machine (and no cookies are sent in the plain).
292.Pp
293If the user is using an authentication agent, the connection to the agent
294is automatically forwarded to the remote side unless disabled on
295command line or in a configuration file.
296.Pp
297Forwarding of arbitrary TCP/IP connections over the secure channel can
610cd5c6 298be specified either on command line or in a configuration file.
299One possible application of TCP/IP forwarding is a secure connection to an
bf740959 300electronic purse; another is going trough firewalls.
301.Pp
1d1ffb87 302.Ss Server authentication
303.Pp
bf740959 304.Nm
1d1ffb87 305automatically maintains and checks a database containing
610cd5c6 306identifications for all hosts it has ever been used with.
1d1ffb87 307RSA host keys are stored in
308.Pa $HOME/.ssh/known_hosts
309and
310DSA host keys are stored in
311.Pa $HOME/.ssh/known_hosts2
610cd5c6 312in the user's home directory.
1d1ffb87 313Additionally, the files
5f4fdfae 314.Pa /etc/ssh_known_hosts
1d1ffb87 315and
316.Pa /etc/ssh_known_hosts2
317are automatically checked for known hosts.
610cd5c6 318Any new hosts are automatically added to the user's file.
319If a host's identification
bf740959 320ever changes,
321.Nm
322warns about this and disables password authentication to prevent a
610cd5c6 323trojan horse from getting the user's password.
324Another purpose of
bf740959 325this mechanism is to prevent man-in-the-middle attacks which could
610cd5c6 326otherwise be used to circumvent the encryption.
327The
bf740959 328.Cm StrictHostKeyChecking
329option (see below) can be used to prevent logins to machines whose
330host key is not known or has changed.
331.Sh OPTIONS
332.Bl -tag -width Ds
333.It Fl a
4fe2af09 334Disables forwarding of the authentication agent connection.
71276795 335.It Fl A
336Enables forwarding of the authentication agent connection.
337This can also be specified on a per-host basis in a configuration file.
bf740959 338.It Fl c Ar blowfish|3des
f54651ce 339Selects the cipher to use for encrypting the session.
bf740959 340.Ar 3des
610cd5c6 341is used by default.
f54651ce 342It is believed to be secure.
bf740959 343.Ar 3des
344(triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
345It is presumably more secure than the
346.Ar des
d0c832f3 347cipher which is no longer supported in
348.Nm ssh .
bf740959 349.Ar blowfish
350is a fast block cipher, it appears very secure and is much faster than
610cd5c6 351.Ar 3des .
d0c832f3 352.It Fl c Ar "3des-cbc,blowfish-cbc,arcfour,cast128-cbc"
353Additionally, for protocol version 2 a comma-separated list of ciphers can
354be specified in order of preference. Protocol version 2 supports
3553DES, Blowfish and CAST128 in CBC mode and Arcfour.
bf740959 356.It Fl e Ar ch|^ch|none
357Sets the escape character for sessions with a pty (default:
358.Ql ~ ) .
610cd5c6 359The escape character is only recognized at the beginning of a line.
360The escape character followed by a dot
bf740959 361.Pq Ql \&.
362closes the connection, followed
363by control-Z suspends the connection, and followed by itself sends the
610cd5c6 364escape character once.
365Setting the character to
bf740959 366.Dq none
367disables any escapes and makes the session fully transparent.
368.It Fl f
369Requests
370.Nm
610cd5c6 371to go to background just before command execution.
372This is useful if
bf740959 373.Nm
374is going to ask for passwords or passphrases, but the user
610cd5c6 375wants it in the background.
f54651ce 376This implies
bf740959 377.Fl n .
378The recommended way to start X11 programs at a remote site is with
379something like
380.Ic ssh -f host xterm .
7b2ea3a1 381.It Fl g
382Allows remote hosts to connect to local forwarded ports.
bf740959 383.It Fl i Ar identity_file
f54651ce 384Selects the file from which the identity (private key) for
610cd5c6 385RSA authentication is read.
f54651ce 386Default is
1d1ffb87 387.Pa $HOME/.ssh/identity
610cd5c6 388in the user's home directory.
389Identity files may also be specified on
390a per-host basis in the configuration file.
391It is possible to have multiple
bf740959 392.Fl i
393options (and multiple identities specified in
394configuration files).
bf740959 395.It Fl k
4fe2af09 396Disables forwarding of Kerberos tickets and AFS tokens.
397This may also be specified on a per-host basis in the configuration file.
bf740959 398.It Fl l Ar login_name
610cd5c6 399Specifies the user to log in as on the remote machine.
400This also may be specified on a per-host basis in the configuration file.
bf740959 401.It Fl n
402Redirects stdin from
403.Pa /dev/null
404(actually, prevents reading from stdin).
405This must be used when
406.Nm
610cd5c6 407is run in the background.
408A common trick is to use this to run X11 programs on a remote machine.
409For example,
bf740959 410.Ic ssh -n shadows.cs.hut.fi emacs &
411will start an emacs on shadows.cs.hut.fi, and the X11
412connection will be automatically forwarded over an encrypted channel.
413The
414.Nm
415program will be put in the background.
416(This does not work if
417.Nm
418needs to ask for a password or passphrase; see also the
419.Fl f
420option.)
0e73cc53 421.It Fl N
422Do not execute a remote command.
423This is usefull if you just want to forward ports
424(protocol version 2 only).
bf740959 425.It Fl o Ar option
426Can be used to give options in the format used in the config file.
427This is useful for specifying options for which there is no separate
610cd5c6 428command-line flag.
429The option has the same format as a line in the configuration file.
bf740959 430.It Fl p Ar port
610cd5c6 431Port to connect to on the remote host.
432This can be specified on a
bf740959 433per-host basis in the configuration file.
434.It Fl P
435Use a non-privileged port for outgoing connections.
436This can be used if your firewall does
437not permit connections from privileged ports.
95f1eccc 438Note that this option turns off
bf740959 439.Cm RhostsAuthentication
440and
441.Cm RhostsRSAAuthentication .
442.It Fl q
610cd5c6 443Quiet mode.
444Causes all warning and diagnostic messages to be suppressed.
445Only fatal errors are displayed.
bf740959 446.It Fl t
610cd5c6 447Force pseudo-tty allocation.
4fe2af09 448This can be used to execute arbitrary
610cd5c6 449screen-based programs on a remote machine, which can be very useful,
450e.g., when implementing menu services.
0e73cc53 451.It Fl T
452Disable pseudo-tty allocation (protocol version 2 only).
bf740959 453.It Fl v
610cd5c6 454Verbose mode.
455Causes
bf740959 456.Nm
610cd5c6 457to print debugging messages about its progress.
458This is helpful in
bf740959 459debugging connection, authentication, and configuration problems.
460The verbose mode is also used to display
461.Xr skey 1
462challenges, if the user entered "s/key" as password.
463.It Fl x
610cd5c6 464Disables X11 forwarding.
bf740959 465.It Fl X
466Enables X11 forwarding.
71276795 467This can also be specified on a per-host basis in a configuration file.
bf740959 468.It Fl C
469Requests compression of all data (including stdin, stdout, stderr, and
610cd5c6 470data for forwarded X11 and TCP/IP connections).
471The compression algorithm is the same used by
7b2ea3a1 472.Xr gzip 1 ,
473and the
bf740959 474.Dq level
475can be controlled by the
476.Cm CompressionLevel
610cd5c6 477option (see below).
478Compression is desirable on modem lines and other
bf740959 479slow connections, but will only slow down things on fast networks.
480The default value can be set on a host-by-host basis in the
481configuration files; see the
482.Cm Compress
483option below.
484.It Fl L Ar port:host:hostport
485Specifies that the given port on the local (client) host is to be
610cd5c6 486forwarded to the given host and port on the remote side.
487This works by allocating a socket to listen to
bf740959 488.Ar port
489on the local side, and whenever a connection is made to this port, the
490connection is forwarded over the secure channel, and a connection is
491made to
48e671d5 492.Ar host
493port
494.Ar hostport
610cd5c6 495from the remote machine.
496Port forwardings can also be specified in the configuration file.
497Only root can forward privileged ports.
48e671d5 498IPv6 addresses can be specified with an alternative syntax:
499.Ar port/host/hostport
bf740959 500.It Fl R Ar port:host:hostport
501Specifies that the given port on the remote (server) host is to be
610cd5c6 502forwarded to the given host and port on the local side.
503This works by allocating a socket to listen to
bf740959 504.Ar port
505on the remote side, and whenever a connection is made to this port, the
506connection is forwarded over the secure channel, and a connection is
507made to
48e671d5 508.Ar host
509port
510.Ar hostport
610cd5c6 511from the local machine.
512Port forwardings can also be specified in the configuration file.
513Privileged ports can be forwarded only when
bf740959 514logging in as root on the remote machine.
6ae2364d 515.It Fl 2
516Forces
517.Nm
1d1ffb87 518to try protocol version 2 only.
48e671d5 519.It Fl 4
520Forces
521.Nm
522to use IPv4 addresses only.
523.It Fl 6
524Forces
525.Nm
526to use IPv6 addresses only.
bf740959 527.El
528.Sh CONFIGURATION FILES
529.Nm
530obtains configuration data from the following sources (in this order):
531command line options, user's configuration file
532.Pq Pa $HOME/.ssh/config ,
533and system-wide configuration file
5f4fdfae 534.Pq Pa /etc/ssh_config .
bf740959 535For each parameter, the first obtained value
610cd5c6 536will be used.
537The configuration files contain sections bracketed by
538.Dq Host
539specifications, and that section is only applied for hosts that
540match one of the patterns given in the specification.
541The matched host name is the one given on the command line.
bf740959 542.Pp
543Since the first obtained value for each parameter is used, more
544host-specific declarations should be given near the beginning of the
545file, and general defaults at the end.
546.Pp
547The configuration file has the following format:
548.Pp
549Empty lines and lines starting with
550.Ql #
551are comments.
552.Pp
553Otherwise a line is of the format
554.Dq keyword arguments .
555The possible
556keywords and their meanings are as follows (note that the
557configuration files are case-sensitive):
558.Bl -tag -width Ds
559.It Cm Host
560Restricts the following declarations (up to the next
561.Cm Host
562keyword) to be only for those hosts that match one of the patterns
563given after the keyword.
564.Ql \&*
565and
566.Ql ?
567can be used as wildcards in the
610cd5c6 568patterns.
569A single
bf740959 570.Ql \&*
571as a pattern can be used to provide global
610cd5c6 572defaults for all hosts.
573The host is the
bf740959 574.Ar hostname
575argument given on the command line (i.e., the name is not converted to
576a canonicalized host name before matching).
577.It Cm AFSTokenPassing
4fe2af09 578Specifies whether to pass AFS tokens to remote host.
579The argument to this keyword must be
bf740959 580.Dq yes
581or
582.Dq no .
583.It Cm BatchMode
584If set to
585.Dq yes ,
610cd5c6 586passphrase/password querying will be disabled.
587This option is useful in scripts and other batch jobs where you have no
588user to supply the password.
589The argument must be
bf740959 590.Dq yes
591or
592.Dq no .
7b2ea3a1 593.It Cm CheckHostIP
594If this flag is set to
595.Dq yes ,
596ssh will additionally check the host ip address in the
597.Pa known_hosts
4fe2af09 598file.
599This allows ssh to detect if a host key changed due to DNS spoofing.
7b2ea3a1 600If the option is set to
601.Dq no ,
602the check will not be executed.
bf740959 603.It Cm Cipher
610cd5c6 604Specifies the cipher to use for encrypting the session.
605Currently,
bf740959 606.Dq blowfish ,
607and
608.Dq 3des
610cd5c6 609are supported.
610The default is
bf740959 611.Dq 3des .
f54651ce 612.It Cm Ciphers
613Specifies the ciphers allowed for protocol version 2
614in order of preference.
615Multiple ciphers must be comma-separated.
616The default is
d0c832f3 617.Dq 3des-cbc,blowfish-cbc,arcfour,cast128-cbc .
bf740959 618.It Cm Compression
610cd5c6 619Specifies whether to use compression.
620The argument must be
bf740959 621.Dq yes
622or
623.Dq no .
624.It Cm CompressionLevel
610cd5c6 625Specifies the compression level to use if compression is enable.
626The argument must be an integer from 1 (fast) to 9 (slow, best).
627The default level is 6, which is good for most applications.
628The meaning of the values is the same as in
7b2ea3a1 629.Xr gzip 1 .
bf740959 630.It Cm ConnectionAttempts
631Specifies the number of tries (one per second) to make before falling
610cd5c6 632back to rsh or exiting.
633The argument must be an integer.
634This may be useful in scripts if the connection sometimes fails.
1d1ffb87 635.It Cm DSAAuthentication
636Specifies whether to try DSA authentication.
637The argument to this keyword must be
638.Dq yes
639or
640.Dq no .
641DSA authentication will only be
642attempted if a DSA identity file exists.
643Note that this option applies to protocol version 2 only.
bf740959 644.It Cm EscapeChar
645Sets the escape character (default:
646.Ql ~ ) .
647The escape character can also
610cd5c6 648be set on the command line.
649The argument should be a single character,
bf740959 650.Ql ^
651followed by a letter, or
652.Dq none
653to disable the escape
654character entirely (making the connection transparent for binary
655data).
f54651ce 656.It Cm FallBackToRsh
bf740959 657Specifies that if connecting via
658.Nm
659fails due to a connection refused error (there is no
660.Xr sshd 8
f54651ce 661listening on the remote host),
bf740959 662.Xr rsh 1
663should automatically be used instead (after a suitable warning about
610cd5c6 664the session being unencrypted).
665The argument must be
bf740959 666.Dq yes
667or
668.Dq no .
669.It Cm ForwardAgent
670Specifies whether the connection to the authentication agent (if any)
610cd5c6 671will be forwarded to the remote machine.
672The argument must be
bf740959 673.Dq yes
674or
675.Dq no .
71276795 676The default is
677.Dq no .
bf740959 678.It Cm ForwardX11
679Specifies whether X11 connections will be automatically redirected
f54651ce 680over the secure channel and
bf740959 681.Ev DISPLAY
610cd5c6 682set.
f54651ce 683The argument must be
bf740959 684.Dq yes
685or
686.Dq no .
c8d54615 687The default is
688.Dq no .
bf740959 689.It Cm GatewayPorts
690Specifies whether remote hosts are allowed to connect to local
691forwarded ports.
692The argument must be
693.Dq yes
694or
695.Dq no .
696The default is
697.Dq no .
698.It Cm GlobalKnownHostsFile
f54651ce 699Specifies a file to use instead of
5f4fdfae 700.Pa /etc/ssh_known_hosts .
bf740959 701.It Cm HostName
610cd5c6 702Specifies the real host name to log into.
703This can be used to specify nicknames or abbreviations for hosts.
704Default is the name given on the command line.
705Numeric IP addresses are also permitted (both on the command line and in
bf740959 706.Cm HostName
707specifications).
708.It Cm IdentityFile
709Specifies the file from which the user's RSA authentication identity
710is read (default
1d1ffb87 711.Pa $HOME/.ssh/identity
bf740959 712in the user's home directory).
713Additionally, any identities represented by the authentication agent
610cd5c6 714will be used for authentication.
715The file name may use the tilde
716syntax to refer to a user's home directory.
717It is possible to have
bf740959 718multiple identity files specified in configuration files; all these
719identities will be tried in sequence.
1d1ffb87 720.It Cm IdentityFile2
721Specifies the file from which the user's DSA authentication identity
722is read (default
723.Pa $HOME/.ssh/id_dsa
724in the user's home directory).
725The file name may use the tilde
726syntax to refer to a user's home directory.
727It is possible to have
728multiple identity files specified in configuration files; all these
729identities will be tried in sequence.
bf740959 730.It Cm KeepAlive
731Specifies whether the system should send keepalive messages to the
610cd5c6 732other side.
733If they are sent, death of the connection or crash of one
734of the machines will be properly noticed.
735However, this means that
bf740959 736connections will die if the route is down temporarily, and some people
4fe2af09 737find it annoying.
bf740959 738.Pp
739The default is
740.Dq yes
741(to send keepalives), and the client will notice
610cd5c6 742if the network goes down or the remote host dies.
743This is important in scripts, and many users want it too.
bf740959 744.Pp
745To disable keepalives, the value should be set to
746.Dq no
747in both the server and the client configuration files.
748.It Cm KerberosAuthentication
4fe2af09 749Specifies whether Kerberos authentication will be used.
750The argument to this keyword must be
bf740959 751.Dq yes
752or
753.Dq no .
754.It Cm KerberosTgtPassing
4fe2af09 755Specifies whether a Kerberos TGT will be forwarded to the server.
756This will only work if the Kerberos server is actually an AFS kaserver.
757The argument to this keyword must be
bf740959 758.Dq yes
759or
760.Dq no .
761.It Cm LocalForward
762Specifies that a TCP/IP port on the local machine be forwarded over
610cd5c6 763the secure channel to given host:port from the remote machine.
764The first argument must be a port number, and the second must be
765host:port.
766Multiple forwardings may be specified, and additional
767forwardings can be given on the command line.
768Only the superuser can forward privileged ports.
6a17f9c2 769.It Cm LogLevel
770Gives the verbosity level that is used when logging messages from
771.Nm ssh .
772The possible values are:
22fa590f 773QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
6a17f9c2 774The default is INFO.
bf740959 775.It Cm NumberOfPasswordPrompts
4fe2af09 776Specifies the number of password prompts before giving up.
777The argument to this keyword must be an integer.
778Default is 3.
7b2ea3a1 779.It Cm PasswordAuthentication
610cd5c6 780Specifies whether to use password authentication.
781The argument to this keyword must be
7b2ea3a1 782.Dq yes
783or
784.Dq no .
1d1ffb87 785Note that this option applies to both protocol version 1 and 2.
bf740959 786.It Cm Port
610cd5c6 787Specifies the port number to connect on the remote host.
788Default is 22.
f54651ce 789.It Cm Protocol
790Specifies the protocol versions
791.Nm
792should support in order of preference.
793The possible values are
794.Dq 1
795and
796.Dq 2 .
797Multiple versions must be comma-separated.
798The default is
1d1ffb87 799.Dq 1,2 .
800This means that
801.Nm
802tries version 1 and falls back to version 2
d0c832f3 803if version 1 is not available.
bf740959 804.It Cm ProxyCommand
610cd5c6 805Specifies the command to use to connect to the server.
806The command
807string extends to the end of the line, and is executed with
808.Pa /bin/sh .
809In the command string,
810.Ql %h
811will be substituted by the host name to
812connect and
813.Ql %p
814by the port.
815The command can be basically anything,
816and should read from its standard input and write to its standard output.
817It should eventually connect an
bf740959 818.Xr sshd 8
819server running on some machine, or execute
820.Ic sshd -i
610cd5c6 821somewhere.
822Host key management will be done using the
bf740959 823HostName of the host being connected (defaulting to the name typed by
824the user).
57112b5a 825Note that
826.Cm CheckHostIP
827is not available for connects with a proxy command.
bf740959 828.Pp
829.It Cm RemoteForward
830Specifies that a TCP/IP port on the remote machine be forwarded over
610cd5c6 831the secure channel to given host:port from the local machine.
832The first argument must be a port number, and the second must be
833host:port.
834Multiple forwardings may be specified, and additional
835forwardings can be given on the command line.
836Only the superuser can forward privileged ports.
bf740959 837.It Cm RhostsAuthentication
610cd5c6 838Specifies whether to try rhosts based authentication.
839Note that this
bf740959 840declaration only affects the client side and has no effect whatsoever
610cd5c6 841on security.
842Disabling rhosts authentication may reduce
bf740959 843authentication time on slow connections when rhosts authentication is
610cd5c6 844not used.
845Most servers do not permit RhostsAuthentication because it
846is not secure (see RhostsRSAAuthentication).
847The argument to this keyword must be
bf740959 848.Dq yes
849or
850.Dq no .
851.It Cm RhostsRSAAuthentication
852Specifies whether to try rhosts based authentication with RSA host
610cd5c6 853authentication.
854This is the primary authentication method for most sites.
855The argument must be
bf740959 856.Dq yes
857or
858.Dq no .
859.It Cm RSAAuthentication
610cd5c6 860Specifies whether to try RSA authentication.
861The argument to this keyword must be
bf740959 862.Dq yes
863or
864.Dq no .
865RSA authentication will only be
866attempted if the identity file exists, or an authentication agent is
867running.
1d1ffb87 868Note that this option applies to protocol version 1 only.
5260325f 869.It Cm SkeyAuthentication
870Specifies whether to use
871.Xr skey 1
610cd5c6 872authentication.
873The argument to this keyword must be
5260325f 874.Dq yes
875or
876.Dq no .
877The default is
878.Dq no .
bf740959 879.It Cm StrictHostKeyChecking
880If this flag is set to
f54651ce 881.Dq yes ,
bf740959 882.Nm
883ssh will never automatically add host keys to the
884.Pa $HOME/.ssh/known_hosts
1d1ffb87 885and
886.Pa $HOME/.ssh/known_hosts2
887files, and refuses to connect hosts whose host key has changed.
610cd5c6 888This provides maximum protection against trojan horse attacks.
889However, it can be somewhat annoying if you don't have good
5f4fdfae 890.Pa /etc/ssh_known_hosts
1d1ffb87 891and
892.Pa /etc/ssh_known_hosts2
bf740959 893files installed and frequently
610cd5c6 894connect new hosts.
895Basically this option forces the user to manually
896add any new hosts.
897Normally this option is disabled, and new hosts
898will automatically be added to the known host files.
899The host keys of
900known hosts will be verified automatically in either case.
901The argument must be
bf740959 902.Dq yes
903or
904.Dq no .
bf740959 905.It Cm UsePrivilegedPort
906Specifies whether to use a privileged port for outgoing connections.
907The argument must be
908.Dq yes
909or
910.Dq no .
911The default is
912.Dq yes .
913Note that setting this option to
914.Dq no
95f1eccc 915turns off
bf740959 916.Cm RhostsAuthentication
917and
918.Cm RhostsRSAAuthentication .
7b2ea3a1 919.It Cm User
610cd5c6 920Specifies the user to log in as.
921This can be useful if you have a different user name on different machines.
922This saves the trouble of
7b2ea3a1 923having to remember to give the user name on the command line.
924.It Cm UserKnownHostsFile
925Specifies a file to use instead of
926.Pa $HOME/.ssh/known_hosts .
bf740959 927.It Cm UseRsh
610cd5c6 928Specifies that rlogin/rsh should be used for this host.
929It is possible that the host does not at all support the
bf740959 930.Nm
610cd5c6 931protocol.
932This causes
bf740959 933.Nm
610cd5c6 934to immediately execute
bf740959 935.Xr rsh 1 .
936All other options (except
937.Cm HostName )
610cd5c6 938are ignored if this has been specified.
939The argument must be
bf740959 940.Dq yes
941or
942.Dq no .
fa649821 943.It Cm XAuthLocation
944Specifies the location of the
945.Xr xauth 1
946program.
947The default is
948.Pa /usr/X11R6/bin/xauth .
b5e300c2 949.El
bf740959 950.Sh ENVIRONMENT
951.Nm
952will normally set the following environment variables:
953.Bl -tag -width Ds
954.It Ev DISPLAY
955The
956.Ev DISPLAY
610cd5c6 957variable indicates the location of the X11 server.
f54651ce 958It is automatically set by
bf740959 959.Nm
960to point to a value of the form
961.Dq hostname:n
962where hostname indicates
610cd5c6 963the host where the shell runs, and n is an integer >= 1.
964.Nm
965uses this special value to forward X11 connections over the secure
966channel.
967The user should normally not set DISPLAY explicitly, as that
bf740959 968will render the X11 connection insecure (and will require the user to
969manually copy any required authorization cookies).
970.It Ev HOME
971Set to the path of the user's home directory.
972.It Ev LOGNAME
973Synonym for
974.Ev USER ;
975set for compatibility with systems that use this variable.
976.It Ev MAIL
977Set to point the user's mailbox.
610cd5c6 978.It Ev PATH
bf740959 979Set to the default
980.Ev PATH ,
981as specified when compiling
982.Nm ssh .
983.It Ev SSH_AUTH_SOCK
984indicates the path of a unix-domain socket used to communicate with the
985agent.
986.It Ev SSH_CLIENT
610cd5c6 987Identifies the client end of the connection.
988The variable contains
bf740959 989three space-separated values: client ip-address, client port number,
990and server port number.
991.It Ev SSH_TTY
992This is set to the name of the tty (path to the device) associated
610cd5c6 993with the current shell or command.
994If the current session has no tty,
bf740959 995this variable is not set.
996.It Ev TZ
997The timezone variable is set to indicate the present timezone if it
c345cf9d 998was set when the daemon was started (i.e., the daemon passes the value
bf740959 999on to new connections).
1000.It Ev USER
1001Set to the name of the user logging in.
1002.El
1003.Pp
f54651ce 1004Additionally,
bf740959 1005.Nm
f54651ce 1006reads
1007.Pa $HOME/.ssh/environment ,
bf740959 1008and adds lines of the format
1009.Dq VARNAME=value
1010to the environment.
1011.Sh FILES
c8d54615 1012.Bl -tag -width Ds
bf740959 1013.It Pa $HOME/.ssh/known_hosts
1014Records host keys for all hosts the user has logged into (that are not
1015in
5f4fdfae 1016.Pa /etc/ssh_known_hosts ) .
bf740959 1017See
1018.Xr sshd 8 .
1d1ffb87 1019.It Pa $HOME/.ssh/identity, $HOME/.ssh/id_dsa
1020Contains the RSA and the DSA authentication identity of the user.
1021These files
1022contain sensitive data and should be readable by the user but not
bf740959 1023accessible by others (read/write/execute).
1024Note that
1025.Nm
1d1ffb87 1026ignores a private key file if it is accessible by others.
bf740959 1027It is possible to specify a passphrase when
1028generating the key; the passphrase will be used to encrypt the
1029sensitive part of this file using 3DES.
1d1ffb87 1030.It Pa $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub
bf740959 1031Contains the public key for authentication (public part of the
610cd5c6 1032identity file in human-readable form).
1d1ffb87 1033The contents of the
1034.Pa $HOME/.ssh/identity.pub
1035file should be added to
bf740959 1036.Pa $HOME/.ssh/authorized_keys
1037on all machines
610cd5c6 1038where you wish to log in using RSA authentication.
1d1ffb87 1039The contents of the
1040.Pa $HOME/.ssh/id_dsa.pub
1041file should be added to
1042.Pa $HOME/.ssh/authorized_keys2
1043on all machines
1044where you wish to log in using DSA authentication.
1045These files are not
610cd5c6 1046sensitive and can (but need not) be readable by anyone.
1d1ffb87 1047These files are
1048never used automatically and are not necessary; they is only provided for
bf740959 1049the convenience of the user.
1050.It Pa $HOME/.ssh/config
610cd5c6 1051This is the per-user configuration file.
1052The format of this file is described above.
1053This file is used by the
bf740959 1054.Nm
610cd5c6 1055client.
1056This file does not usually contain any sensitive information,
bf740959 1057but the recommended permissions are read/write for the user, and not
1058accessible by others.
1059.It Pa $HOME/.ssh/authorized_keys
610cd5c6 1060Lists the RSA keys that can be used for logging in as this user.
1061The format of this file is described in the
bf740959 1062.Xr sshd 8
610cd5c6 1063manual page.
1064In the simplest form the format is the same as the .pub
bf740959 1065identity files (that is, each line contains the number of bits in
1066modulus, public exponent, modulus, and comment fields, separated by
610cd5c6 1067spaces).
1068This file is not highly sensitive, but the recommended
bf740959 1069permissions are read/write for the user, and not accessible by others.
1d1ffb87 1070.It Pa $HOME/.ssh/authorized_keys2
1071Lists the DSA keys that can be used for logging in as this user.
1072This file is not highly sensitive, but the recommended
1073permissions are read/write for the user, and not accessible by others.
1074.It Pa /etc/ssh_known_hosts, /etc/ssh_known_hosts2
610cd5c6 1075Systemwide list of known host keys.
1d1ffb87 1076.Pa /etc/ssh_known_hosts
1077contains RSA and
1078.Pa /etc/ssh_known_hosts2
1079contains DSA keys.
1080These files should be prepared by the
bf740959 1081system administrator to contain the public host keys of all machines in the
610cd5c6 1082organization.
1083This file should be world-readable.
1084This file contains
bf740959 1085public keys, one per line, in the following format (fields separated
1086by spaces): system name, number of bits in modulus, public exponent,
610cd5c6 1087modulus, and optional comment field.
1088When different names are used
bf740959 1089for the same machine, all such names should be listed, separated by
610cd5c6 1090commas.
1091The format is described on the
bf740959 1092.Xr sshd 8
1093manual page.
1094.Pp
1095The canonical system name (as returned by name servers) is used by
1096.Xr sshd 8
1097to verify the client host when logging in; other names are needed because
1098.Nm
1099does not convert the user-supplied name to a canonical name before
1100checking the key, because someone with access to the name servers
1101would then be able to fool host authentication.
5f4fdfae 1102.It Pa /etc/ssh_config
610cd5c6 1103Systemwide configuration file.
1104This file provides defaults for those
bf740959 1105values that are not specified in the user's configuration file, and
610cd5c6 1106for those users who do not have a configuration file.
1107This file must be world-readable.
bf740959 1108.It Pa $HOME/.rhosts
1109This file is used in
1110.Pa \&.rhosts
1111authentication to list the
610cd5c6 1112host/user pairs that are permitted to log in.
1113(Note that this file is
bf740959 1114also used by rlogin and rsh, which makes using this file insecure.)
1115Each line of the file contains a host name (in the canonical form
1116returned by name servers), and then a user name on that host,
610cd5c6 1117separated by a space.
1118One some machines this file may need to be
bf740959 1119world-readable if the user's home directory is on a NFS partition,
1120because
1121.Xr sshd 8
610cd5c6 1122reads it as root.
1123Additionally, this file must be owned by the user,
1124and must not have write permissions for anyone else.
1125The recommended
bf740959 1126permission for most machines is read/write for the user, and not
1127accessible by others.
1128.Pp
1129Note that by default
1130.Xr sshd 8
1131will be installed so that it requires successful RSA host
610cd5c6 1132authentication before permitting \s+2.\s0rhosts authentication.
1133If your server machine does not have the client's host key in
5f4fdfae 1134.Pa /etc/ssh_known_hosts ,
bf740959 1135you can store it in
1136.Pa $HOME/.ssh/known_hosts .
1137The easiest way to do this is to
1138connect back to the client from the server machine using ssh; this
1d1ffb87 1139will automatically add the host key to
bf740959 1140.Pa $HOME/.ssh/known_hosts .
1141.It Pa $HOME/.shosts
1142This file is used exactly the same way as
1143.Pa \&.rhosts .
1144The purpose for
1145having this file is to be able to use rhosts authentication with
1146.Nm
1147without permitting login with
1148.Xr rlogin 1
1149or
1150.Xr rsh 1 .
1151.It Pa /etc/hosts.equiv
1152This file is used during
610cd5c6 1153.Pa \&.rhosts authentication.
1154It contains
bf740959 1155canonical hosts names, one per line (the full format is described on
1156the
1157.Xr sshd 8
610cd5c6 1158manual page).
1159If the client host is found in this file, login is
bf740959 1160automatically permitted provided client and server user names are the
610cd5c6 1161same.
1162Additionally, successful RSA host authentication is normally
1163required.
1164This file should only be writable by root.
5f4fdfae 1165.It Pa /etc/shosts.equiv
f54651ce 1166This file is processed exactly as
bf740959 1167.Pa /etc/hosts.equiv .
1168This file may be useful to permit logins using
1169.Nm
1170but not using rsh/rlogin.
5f4fdfae 1171.It Pa /etc/sshrc
bf740959 1172Commands in this file are executed by
1173.Nm
1174when the user logs in just before the user's shell (or command) is started.
1175See the
1176.Xr sshd 8
1177manual page for more information.
1178.It Pa $HOME/.ssh/rc
1179Commands in this file are executed by
1180.Nm
1181when the user logs in just before the user's shell (or command) is
1182started.
f54651ce 1183See the
bf740959 1184.Xr sshd 8
1185manual page for more information.
83b7f649 1186.It Pa $HOME/.ssh/environment
1187Contains additional definitions for environment variables, see section
1188.Sx ENVIRONMENT
1189above.
bf740959 1190.It Pa libcrypto.so.X.1
1191A version of this library which includes support for the RSA algorithm
1192is required for proper operation.
b5e300c2 1193.El
bf740959 1194.Sh AUTHOR
bf740959 1195OpenSSH
c8d54615 1196is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
610cd5c6 1197but with bugs removed and newer features re-added.
1198Rapidly after the
c8d54615 11991.2.12 release, newer versions of the original ssh bore successively
1200more restrictive licenses, and thus demand for a free version was born.
1d1ffb87 1201.Pp
c8d54615 1202This version of OpenSSH
bf740959 1203.Bl -bullet
1204.It
371ecff9 1205has all components of a restrictive nature (i.e., patents)
bf740959 1206directly removed from the source code; any licensed or patented components
1207are chosen from
1208external libraries.
1209.It
1d1ffb87 1210has been updated to support SSH protocol 1.5 and 2, making it compatible with
1211all other SSH clients and servers.
bf740959 1212.It
f54651ce 1213contains added support for
bf740959 1214.Xr kerberos 8
1215authentication and ticket passing.
1216.It
1217supports one-time password authentication with
1218.Xr skey 1 .
1219.El
1220.Pp
0c16a097 1221OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
f095fcc7 1222Niels Provos, Theo de Raadt, and Dug Song.
1d1ffb87 1223.Pp
1224The support for SSH protocol 2 was written by Markus Friedl.
bf740959 1225.Sh SEE ALSO
1226.Xr rlogin 1 ,
1227.Xr rsh 1 ,
1228.Xr scp 1 ,
1229.Xr ssh-add 1 ,
1230.Xr ssh-agent 1 ,
1231.Xr ssh-keygen 1 ,
1232.Xr telnet 1 ,
1233.Xr sshd 8 ,
This page took 0.304323 seconds and 5 git commands to generate.