]> andersk Git - openssh.git/blame - ssh.1
Up ver
[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
0e73cc53 27.Op Fl afgknqtvxCNPTX246
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.
335This may also be specified on a per-host basis in the configuration file.
bf740959 336.It Fl c Ar blowfish|3des
f54651ce 337Selects the cipher to use for encrypting the session.
bf740959 338.Ar 3des
610cd5c6 339is used by default.
f54651ce 340It is believed to be secure.
bf740959 341.Ar 3des
342(triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
343It is presumably more secure than the
344.Ar des
d0c832f3 345cipher which is no longer supported in
346.Nm ssh .
bf740959 347.Ar blowfish
348is a fast block cipher, it appears very secure and is much faster than
610cd5c6 349.Ar 3des .
d0c832f3 350.It Fl c Ar "3des-cbc,blowfish-cbc,arcfour,cast128-cbc"
351Additionally, for protocol version 2 a comma-separated list of ciphers can
352be specified in order of preference. Protocol version 2 supports
3533DES, Blowfish and CAST128 in CBC mode and Arcfour.
bf740959 354.It Fl e Ar ch|^ch|none
355Sets the escape character for sessions with a pty (default:
356.Ql ~ ) .
610cd5c6 357The escape character is only recognized at the beginning of a line.
358The escape character followed by a dot
bf740959 359.Pq Ql \&.
360closes the connection, followed
361by control-Z suspends the connection, and followed by itself sends the
610cd5c6 362escape character once.
363Setting the character to
bf740959 364.Dq none
365disables any escapes and makes the session fully transparent.
366.It Fl f
367Requests
368.Nm
610cd5c6 369to go to background just before command execution.
370This is useful if
bf740959 371.Nm
372is going to ask for passwords or passphrases, but the user
610cd5c6 373wants it in the background.
f54651ce 374This implies
bf740959 375.Fl n .
376The recommended way to start X11 programs at a remote site is with
377something like
378.Ic ssh -f host xterm .
7b2ea3a1 379.It Fl g
380Allows remote hosts to connect to local forwarded ports.
bf740959 381.It Fl i Ar identity_file
f54651ce 382Selects the file from which the identity (private key) for
610cd5c6 383RSA authentication is read.
f54651ce 384Default is
1d1ffb87 385.Pa $HOME/.ssh/identity
610cd5c6 386in the user's home directory.
387Identity files may also be specified on
388a per-host basis in the configuration file.
389It is possible to have multiple
bf740959 390.Fl i
391options (and multiple identities specified in
392configuration files).
bf740959 393.It Fl k
4fe2af09 394Disables forwarding of Kerberos tickets and AFS tokens.
395This may also be specified on a per-host basis in the configuration file.
bf740959 396.It Fl l Ar login_name
610cd5c6 397Specifies the user to log in as on the remote machine.
398This also may be specified on a per-host basis in the configuration file.
bf740959 399.It Fl n
400Redirects stdin from
401.Pa /dev/null
402(actually, prevents reading from stdin).
403This must be used when
404.Nm
610cd5c6 405is run in the background.
406A common trick is to use this to run X11 programs on a remote machine.
407For example,
bf740959 408.Ic ssh -n shadows.cs.hut.fi emacs &
409will start an emacs on shadows.cs.hut.fi, and the X11
410connection will be automatically forwarded over an encrypted channel.
411The
412.Nm
413program will be put in the background.
414(This does not work if
415.Nm
416needs to ask for a password or passphrase; see also the
417.Fl f
418option.)
0e73cc53 419.It Fl N
420Do not execute a remote command.
421This is usefull if you just want to forward ports
422(protocol version 2 only).
bf740959 423.It Fl o Ar option
424Can be used to give options in the format used in the config file.
425This is useful for specifying options for which there is no separate
610cd5c6 426command-line flag.
427The option has the same format as a line in the configuration file.
bf740959 428.It Fl p Ar port
610cd5c6 429Port to connect to on the remote host.
430This can be specified on a
bf740959 431per-host basis in the configuration file.
432.It Fl P
433Use a non-privileged port for outgoing connections.
434This can be used if your firewall does
435not permit connections from privileged ports.
95f1eccc 436Note that this option turns off
bf740959 437.Cm RhostsAuthentication
438and
439.Cm RhostsRSAAuthentication .
440.It Fl q
610cd5c6 441Quiet mode.
442Causes all warning and diagnostic messages to be suppressed.
443Only fatal errors are displayed.
bf740959 444.It Fl t
610cd5c6 445Force pseudo-tty allocation.
4fe2af09 446This can be used to execute arbitrary
610cd5c6 447screen-based programs on a remote machine, which can be very useful,
448e.g., when implementing menu services.
0e73cc53 449.It Fl T
450Disable pseudo-tty allocation (protocol version 2 only).
bf740959 451.It Fl v
610cd5c6 452Verbose mode.
453Causes
bf740959 454.Nm
610cd5c6 455to print debugging messages about its progress.
456This is helpful in
bf740959 457debugging connection, authentication, and configuration problems.
458The verbose mode is also used to display
459.Xr skey 1
460challenges, if the user entered "s/key" as password.
461.It Fl x
610cd5c6 462Disables X11 forwarding.
463This can also be specified on a per-host basis in a configuration file.
bf740959 464.It Fl X
465Enables X11 forwarding.
466.It Fl C
467Requests compression of all data (including stdin, stdout, stderr, and
610cd5c6 468data for forwarded X11 and TCP/IP connections).
469The compression algorithm is the same used by
7b2ea3a1 470.Xr gzip 1 ,
471and the
bf740959 472.Dq level
473can be controlled by the
474.Cm CompressionLevel
610cd5c6 475option (see below).
476Compression is desirable on modem lines and other
bf740959 477slow connections, but will only slow down things on fast networks.
478The default value can be set on a host-by-host basis in the
479configuration files; see the
480.Cm Compress
481option below.
482.It Fl L Ar port:host:hostport
483Specifies that the given port on the local (client) host is to be
610cd5c6 484forwarded to the given host and port on the remote side.
485This works by allocating a socket to listen to
bf740959 486.Ar port
487on the local side, and whenever a connection is made to this port, the
488connection is forwarded over the secure channel, and a connection is
489made to
48e671d5 490.Ar host
491port
492.Ar hostport
610cd5c6 493from the remote machine.
494Port forwardings can also be specified in the configuration file.
495Only root can forward privileged ports.
48e671d5 496IPv6 addresses can be specified with an alternative syntax:
497.Ar port/host/hostport
bf740959 498.It Fl R Ar port:host:hostport
499Specifies that the given port on the remote (server) host is to be
610cd5c6 500forwarded to the given host and port on the local side.
501This works by allocating a socket to listen to
bf740959 502.Ar port
503on the remote side, and whenever a connection is made to this port, the
504connection is forwarded over the secure channel, and a connection is
505made to
48e671d5 506.Ar host
507port
508.Ar hostport
610cd5c6 509from the local machine.
510Port forwardings can also be specified in the configuration file.
511Privileged ports can be forwarded only when
bf740959 512logging in as root on the remote machine.
6ae2364d 513.It Fl 2
514Forces
515.Nm
1d1ffb87 516to try protocol version 2 only.
48e671d5 517.It Fl 4
518Forces
519.Nm
520to use IPv4 addresses only.
521.It Fl 6
522Forces
523.Nm
524to use IPv6 addresses only.
bf740959 525.El
526.Sh CONFIGURATION FILES
527.Nm
528obtains configuration data from the following sources (in this order):
529command line options, user's configuration file
530.Pq Pa $HOME/.ssh/config ,
531and system-wide configuration file
5f4fdfae 532.Pq Pa /etc/ssh_config .
bf740959 533For each parameter, the first obtained value
610cd5c6 534will be used.
535The configuration files contain sections bracketed by
536.Dq Host
537specifications, and that section is only applied for hosts that
538match one of the patterns given in the specification.
539The matched host name is the one given on the command line.
bf740959 540.Pp
541Since the first obtained value for each parameter is used, more
542host-specific declarations should be given near the beginning of the
543file, and general defaults at the end.
544.Pp
545The configuration file has the following format:
546.Pp
547Empty lines and lines starting with
548.Ql #
549are comments.
550.Pp
551Otherwise a line is of the format
552.Dq keyword arguments .
553The possible
554keywords and their meanings are as follows (note that the
555configuration files are case-sensitive):
556.Bl -tag -width Ds
557.It Cm Host
558Restricts the following declarations (up to the next
559.Cm Host
560keyword) to be only for those hosts that match one of the patterns
561given after the keyword.
562.Ql \&*
563and
564.Ql ?
565can be used as wildcards in the
610cd5c6 566patterns.
567A single
bf740959 568.Ql \&*
569as a pattern can be used to provide global
610cd5c6 570defaults for all hosts.
571The host is the
bf740959 572.Ar hostname
573argument given on the command line (i.e., the name is not converted to
574a canonicalized host name before matching).
575.It Cm AFSTokenPassing
4fe2af09 576Specifies whether to pass AFS tokens to remote host.
577The argument to this keyword must be
bf740959 578.Dq yes
579or
580.Dq no .
581.It Cm BatchMode
582If set to
583.Dq yes ,
610cd5c6 584passphrase/password querying will be disabled.
585This option is useful in scripts and other batch jobs where you have no
586user to supply the password.
587The argument must be
bf740959 588.Dq yes
589or
590.Dq no .
7b2ea3a1 591.It Cm CheckHostIP
592If this flag is set to
593.Dq yes ,
594ssh will additionally check the host ip address in the
595.Pa known_hosts
4fe2af09 596file.
597This allows ssh to detect if a host key changed due to DNS spoofing.
7b2ea3a1 598If the option is set to
599.Dq no ,
600the check will not be executed.
bf740959 601.It Cm Cipher
610cd5c6 602Specifies the cipher to use for encrypting the session.
603Currently,
bf740959 604.Dq blowfish ,
605and
606.Dq 3des
610cd5c6 607are supported.
608The default is
bf740959 609.Dq 3des .
f54651ce 610.It Cm Ciphers
611Specifies the ciphers allowed for protocol version 2
612in order of preference.
613Multiple ciphers must be comma-separated.
614The default is
d0c832f3 615.Dq 3des-cbc,blowfish-cbc,arcfour,cast128-cbc .
bf740959 616.It Cm Compression
610cd5c6 617Specifies whether to use compression.
618The argument must be
bf740959 619.Dq yes
620or
621.Dq no .
622.It Cm CompressionLevel
610cd5c6 623Specifies the compression level to use if compression is enable.
624The argument must be an integer from 1 (fast) to 9 (slow, best).
625The default level is 6, which is good for most applications.
626The meaning of the values is the same as in
7b2ea3a1 627.Xr gzip 1 .
bf740959 628.It Cm ConnectionAttempts
629Specifies the number of tries (one per second) to make before falling
610cd5c6 630back to rsh or exiting.
631The argument must be an integer.
632This may be useful in scripts if the connection sometimes fails.
1d1ffb87 633.It Cm DSAAuthentication
634Specifies whether to try DSA authentication.
635The argument to this keyword must be
636.Dq yes
637or
638.Dq no .
639DSA authentication will only be
640attempted if a DSA identity file exists.
641Note that this option applies to protocol version 2 only.
bf740959 642.It Cm EscapeChar
643Sets the escape character (default:
644.Ql ~ ) .
645The escape character can also
610cd5c6 646be set on the command line.
647The argument should be a single character,
bf740959 648.Ql ^
649followed by a letter, or
650.Dq none
651to disable the escape
652character entirely (making the connection transparent for binary
653data).
f54651ce 654.It Cm FallBackToRsh
bf740959 655Specifies that if connecting via
656.Nm
657fails due to a connection refused error (there is no
658.Xr sshd 8
f54651ce 659listening on the remote host),
bf740959 660.Xr rsh 1
661should automatically be used instead (after a suitable warning about
610cd5c6 662the session being unencrypted).
663The argument must be
bf740959 664.Dq yes
665or
666.Dq no .
667.It Cm ForwardAgent
668Specifies whether the connection to the authentication agent (if any)
610cd5c6 669will be forwarded to the remote machine.
670The argument must be
bf740959 671.Dq yes
672or
673.Dq no .
674.It Cm ForwardX11
675Specifies whether X11 connections will be automatically redirected
f54651ce 676over the secure channel and
bf740959 677.Ev DISPLAY
610cd5c6 678set.
f54651ce 679The argument must be
bf740959 680.Dq yes
681or
682.Dq no .
c8d54615 683The default is
684.Dq no .
bf740959 685.It Cm GatewayPorts
686Specifies whether remote hosts are allowed to connect to local
687forwarded ports.
688The argument must be
689.Dq yes
690or
691.Dq no .
692The default is
693.Dq no .
694.It Cm GlobalKnownHostsFile
f54651ce 695Specifies a file to use instead of
5f4fdfae 696.Pa /etc/ssh_known_hosts .
bf740959 697.It Cm HostName
610cd5c6 698Specifies the real host name to log into.
699This can be used to specify nicknames or abbreviations for hosts.
700Default is the name given on the command line.
701Numeric IP addresses are also permitted (both on the command line and in
bf740959 702.Cm HostName
703specifications).
704.It Cm IdentityFile
705Specifies the file from which the user's RSA authentication identity
706is read (default
1d1ffb87 707.Pa $HOME/.ssh/identity
bf740959 708in the user's home directory).
709Additionally, any identities represented by the authentication agent
610cd5c6 710will be used for authentication.
711The file name may use the tilde
712syntax to refer to a user's home directory.
713It is possible to have
bf740959 714multiple identity files specified in configuration files; all these
715identities will be tried in sequence.
1d1ffb87 716.It Cm IdentityFile2
717Specifies the file from which the user's DSA authentication identity
718is read (default
719.Pa $HOME/.ssh/id_dsa
720in the user's home directory).
721The file name may use the tilde
722syntax to refer to a user's home directory.
723It is possible to have
724multiple identity files specified in configuration files; all these
725identities will be tried in sequence.
bf740959 726.It Cm KeepAlive
727Specifies whether the system should send keepalive messages to the
610cd5c6 728other side.
729If they are sent, death of the connection or crash of one
730of the machines will be properly noticed.
731However, this means that
bf740959 732connections will die if the route is down temporarily, and some people
4fe2af09 733find it annoying.
bf740959 734.Pp
735The default is
736.Dq yes
737(to send keepalives), and the client will notice
610cd5c6 738if the network goes down or the remote host dies.
739This is important in scripts, and many users want it too.
bf740959 740.Pp
741To disable keepalives, the value should be set to
742.Dq no
743in both the server and the client configuration files.
744.It Cm KerberosAuthentication
4fe2af09 745Specifies whether Kerberos authentication will be used.
746The argument to this keyword must be
bf740959 747.Dq yes
748or
749.Dq no .
750.It Cm KerberosTgtPassing
4fe2af09 751Specifies whether a Kerberos TGT will be forwarded to the server.
752This will only work if the Kerberos server is actually an AFS kaserver.
753The argument to this keyword must be
bf740959 754.Dq yes
755or
756.Dq no .
757.It Cm LocalForward
758Specifies that a TCP/IP port on the local machine be forwarded over
610cd5c6 759the secure channel to given host:port from the remote machine.
760The first argument must be a port number, and the second must be
761host:port.
762Multiple forwardings may be specified, and additional
763forwardings can be given on the command line.
764Only the superuser can forward privileged ports.
6a17f9c2 765.It Cm LogLevel
766Gives the verbosity level that is used when logging messages from
767.Nm ssh .
768The possible values are:
22fa590f 769QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
6a17f9c2 770The default is INFO.
bf740959 771.It Cm NumberOfPasswordPrompts
4fe2af09 772Specifies the number of password prompts before giving up.
773The argument to this keyword must be an integer.
774Default is 3.
7b2ea3a1 775.It Cm PasswordAuthentication
610cd5c6 776Specifies whether to use password authentication.
777The argument to this keyword must be
7b2ea3a1 778.Dq yes
779or
780.Dq no .
1d1ffb87 781Note that this option applies to both protocol version 1 and 2.
bf740959 782.It Cm Port
610cd5c6 783Specifies the port number to connect on the remote host.
784Default is 22.
f54651ce 785.It Cm Protocol
786Specifies the protocol versions
787.Nm
788should support in order of preference.
789The possible values are
790.Dq 1
791and
792.Dq 2 .
793Multiple versions must be comma-separated.
794The default is
1d1ffb87 795.Dq 1,2 .
796This means that
797.Nm
798tries version 1 and falls back to version 2
d0c832f3 799if version 1 is not available.
bf740959 800.It Cm ProxyCommand
610cd5c6 801Specifies the command to use to connect to the server.
802The command
803string extends to the end of the line, and is executed with
804.Pa /bin/sh .
805In the command string,
806.Ql %h
807will be substituted by the host name to
808connect and
809.Ql %p
810by the port.
811The command can be basically anything,
812and should read from its standard input and write to its standard output.
813It should eventually connect an
bf740959 814.Xr sshd 8
815server running on some machine, or execute
816.Ic sshd -i
610cd5c6 817somewhere.
818Host key management will be done using the
bf740959 819HostName of the host being connected (defaulting to the name typed by
820the user).
57112b5a 821Note that
822.Cm CheckHostIP
823is not available for connects with a proxy command.
bf740959 824.Pp
825.It Cm RemoteForward
826Specifies that a TCP/IP port on the remote machine be forwarded over
610cd5c6 827the secure channel to given host:port from the local machine.
828The first argument must be a port number, and the second must be
829host:port.
830Multiple forwardings may be specified, and additional
831forwardings can be given on the command line.
832Only the superuser can forward privileged ports.
bf740959 833.It Cm RhostsAuthentication
610cd5c6 834Specifies whether to try rhosts based authentication.
835Note that this
bf740959 836declaration only affects the client side and has no effect whatsoever
610cd5c6 837on security.
838Disabling rhosts authentication may reduce
bf740959 839authentication time on slow connections when rhosts authentication is
610cd5c6 840not used.
841Most servers do not permit RhostsAuthentication because it
842is not secure (see RhostsRSAAuthentication).
843The argument to this keyword must be
bf740959 844.Dq yes
845or
846.Dq no .
847.It Cm RhostsRSAAuthentication
848Specifies whether to try rhosts based authentication with RSA host
610cd5c6 849authentication.
850This is the primary authentication method for most sites.
851The argument must be
bf740959 852.Dq yes
853or
854.Dq no .
855.It Cm RSAAuthentication
610cd5c6 856Specifies whether to try RSA authentication.
857The argument to this keyword must be
bf740959 858.Dq yes
859or
860.Dq no .
861RSA authentication will only be
862attempted if the identity file exists, or an authentication agent is
863running.
1d1ffb87 864Note that this option applies to protocol version 1 only.
5260325f 865.It Cm SkeyAuthentication
866Specifies whether to use
867.Xr skey 1
610cd5c6 868authentication.
869The argument to this keyword must be
5260325f 870.Dq yes
871or
872.Dq no .
873The default is
874.Dq no .
bf740959 875.It Cm StrictHostKeyChecking
876If this flag is set to
f54651ce 877.Dq yes ,
bf740959 878.Nm
879ssh will never automatically add host keys to the
880.Pa $HOME/.ssh/known_hosts
1d1ffb87 881and
882.Pa $HOME/.ssh/known_hosts2
883files, and refuses to connect hosts whose host key has changed.
610cd5c6 884This provides maximum protection against trojan horse attacks.
885However, it can be somewhat annoying if you don't have good
5f4fdfae 886.Pa /etc/ssh_known_hosts
1d1ffb87 887and
888.Pa /etc/ssh_known_hosts2
bf740959 889files installed and frequently
610cd5c6 890connect new hosts.
891Basically this option forces the user to manually
892add any new hosts.
893Normally this option is disabled, and new hosts
894will automatically be added to the known host files.
895The host keys of
896known hosts will be verified automatically in either case.
897The argument must be
bf740959 898.Dq yes
899or
900.Dq no .
bf740959 901.It Cm UsePrivilegedPort
902Specifies whether to use a privileged port for outgoing connections.
903The argument must be
904.Dq yes
905or
906.Dq no .
907The default is
908.Dq yes .
909Note that setting this option to
910.Dq no
95f1eccc 911turns off
bf740959 912.Cm RhostsAuthentication
913and
914.Cm RhostsRSAAuthentication .
7b2ea3a1 915.It Cm User
610cd5c6 916Specifies the user to log in as.
917This can be useful if you have a different user name on different machines.
918This saves the trouble of
7b2ea3a1 919having to remember to give the user name on the command line.
920.It Cm UserKnownHostsFile
921Specifies a file to use instead of
922.Pa $HOME/.ssh/known_hosts .
bf740959 923.It Cm UseRsh
610cd5c6 924Specifies that rlogin/rsh should be used for this host.
925It is possible that the host does not at all support the
bf740959 926.Nm
610cd5c6 927protocol.
928This causes
bf740959 929.Nm
610cd5c6 930to immediately execute
bf740959 931.Xr rsh 1 .
932All other options (except
933.Cm HostName )
610cd5c6 934are ignored if this has been specified.
935The argument must be
bf740959 936.Dq yes
937or
938.Dq no .
939.Sh ENVIRONMENT
940.Nm
941will normally set the following environment variables:
942.Bl -tag -width Ds
943.It Ev DISPLAY
944The
945.Ev DISPLAY
610cd5c6 946variable indicates the location of the X11 server.
f54651ce 947It is automatically set by
bf740959 948.Nm
949to point to a value of the form
950.Dq hostname:n
951where hostname indicates
610cd5c6 952the host where the shell runs, and n is an integer >= 1.
953.Nm
954uses this special value to forward X11 connections over the secure
955channel.
956The user should normally not set DISPLAY explicitly, as that
bf740959 957will render the X11 connection insecure (and will require the user to
958manually copy any required authorization cookies).
959.It Ev HOME
960Set to the path of the user's home directory.
961.It Ev LOGNAME
962Synonym for
963.Ev USER ;
964set for compatibility with systems that use this variable.
965.It Ev MAIL
966Set to point the user's mailbox.
610cd5c6 967.It Ev PATH
bf740959 968Set to the default
969.Ev PATH ,
970as specified when compiling
971.Nm ssh .
972.It Ev SSH_AUTH_SOCK
973indicates the path of a unix-domain socket used to communicate with the
974agent.
975.It Ev SSH_CLIENT
610cd5c6 976Identifies the client end of the connection.
977The variable contains
bf740959 978three space-separated values: client ip-address, client port number,
979and server port number.
980.It Ev SSH_TTY
981This is set to the name of the tty (path to the device) associated
610cd5c6 982with the current shell or command.
983If the current session has no tty,
bf740959 984this variable is not set.
985.It Ev TZ
986The timezone variable is set to indicate the present timezone if it
987was set when the daemon was started (e.i., the daemon passes the value
988on to new connections).
989.It Ev USER
990Set to the name of the user logging in.
991.El
992.Pp
f54651ce 993Additionally,
bf740959 994.Nm
f54651ce 995reads
996.Pa $HOME/.ssh/environment ,
bf740959 997and adds lines of the format
998.Dq VARNAME=value
999to the environment.
1000.Sh FILES
c8d54615 1001.Bl -tag -width Ds
bf740959 1002.It Pa $HOME/.ssh/known_hosts
1003Records host keys for all hosts the user has logged into (that are not
1004in
5f4fdfae 1005.Pa /etc/ssh_known_hosts ) .
bf740959 1006See
1007.Xr sshd 8 .
1d1ffb87 1008.It Pa $HOME/.ssh/identity, $HOME/.ssh/id_dsa
1009Contains the RSA and the DSA authentication identity of the user.
1010These files
1011contain sensitive data and should be readable by the user but not
bf740959 1012accessible by others (read/write/execute).
1013Note that
1014.Nm
1d1ffb87 1015ignores a private key file if it is accessible by others.
bf740959 1016It is possible to specify a passphrase when
1017generating the key; the passphrase will be used to encrypt the
1018sensitive part of this file using 3DES.
1d1ffb87 1019.It Pa $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub
bf740959 1020Contains the public key for authentication (public part of the
610cd5c6 1021identity file in human-readable form).
1d1ffb87 1022The contents of the
1023.Pa $HOME/.ssh/identity.pub
1024file should be added to
bf740959 1025.Pa $HOME/.ssh/authorized_keys
1026on all machines
610cd5c6 1027where you wish to log in using RSA authentication.
1d1ffb87 1028The contents of the
1029.Pa $HOME/.ssh/id_dsa.pub
1030file should be added to
1031.Pa $HOME/.ssh/authorized_keys2
1032on all machines
1033where you wish to log in using DSA authentication.
1034These files are not
610cd5c6 1035sensitive and can (but need not) be readable by anyone.
1d1ffb87 1036These files are
1037never used automatically and are not necessary; they is only provided for
bf740959 1038the convenience of the user.
1039.It Pa $HOME/.ssh/config
610cd5c6 1040This is the per-user configuration file.
1041The format of this file is described above.
1042This file is used by the
bf740959 1043.Nm
610cd5c6 1044client.
1045This file does not usually contain any sensitive information,
bf740959 1046but the recommended permissions are read/write for the user, and not
1047accessible by others.
1048.It Pa $HOME/.ssh/authorized_keys
610cd5c6 1049Lists the RSA keys that can be used for logging in as this user.
1050The format of this file is described in the
bf740959 1051.Xr sshd 8
610cd5c6 1052manual page.
1053In the simplest form the format is the same as the .pub
bf740959 1054identity files (that is, each line contains the number of bits in
1055modulus, public exponent, modulus, and comment fields, separated by
610cd5c6 1056spaces).
1057This file is not highly sensitive, but the recommended
bf740959 1058permissions are read/write for the user, and not accessible by others.
1d1ffb87 1059.It Pa $HOME/.ssh/authorized_keys2
1060Lists the DSA keys that can be used for logging in as this user.
1061This file is not highly sensitive, but the recommended
1062permissions are read/write for the user, and not accessible by others.
1063.It Pa /etc/ssh_known_hosts, /etc/ssh_known_hosts2
610cd5c6 1064Systemwide list of known host keys.
1d1ffb87 1065.Pa /etc/ssh_known_hosts
1066contains RSA and
1067.Pa /etc/ssh_known_hosts2
1068contains DSA keys.
1069These files should be prepared by the
bf740959 1070system administrator to contain the public host keys of all machines in the
610cd5c6 1071organization.
1072This file should be world-readable.
1073This file contains
bf740959 1074public keys, one per line, in the following format (fields separated
1075by spaces): system name, number of bits in modulus, public exponent,
610cd5c6 1076modulus, and optional comment field.
1077When different names are used
bf740959 1078for the same machine, all such names should be listed, separated by
610cd5c6 1079commas.
1080The format is described on the
bf740959 1081.Xr sshd 8
1082manual page.
1083.Pp
1084The canonical system name (as returned by name servers) is used by
1085.Xr sshd 8
1086to verify the client host when logging in; other names are needed because
1087.Nm
1088does not convert the user-supplied name to a canonical name before
1089checking the key, because someone with access to the name servers
1090would then be able to fool host authentication.
5f4fdfae 1091.It Pa /etc/ssh_config
610cd5c6 1092Systemwide configuration file.
1093This file provides defaults for those
bf740959 1094values that are not specified in the user's configuration file, and
610cd5c6 1095for those users who do not have a configuration file.
1096This file must be world-readable.
bf740959 1097.It Pa $HOME/.rhosts
1098This file is used in
1099.Pa \&.rhosts
1100authentication to list the
610cd5c6 1101host/user pairs that are permitted to log in.
1102(Note that this file is
bf740959 1103also used by rlogin and rsh, which makes using this file insecure.)
1104Each line of the file contains a host name (in the canonical form
1105returned by name servers), and then a user name on that host,
610cd5c6 1106separated by a space.
1107One some machines this file may need to be
bf740959 1108world-readable if the user's home directory is on a NFS partition,
1109because
1110.Xr sshd 8
610cd5c6 1111reads it as root.
1112Additionally, this file must be owned by the user,
1113and must not have write permissions for anyone else.
1114The recommended
bf740959 1115permission for most machines is read/write for the user, and not
1116accessible by others.
1117.Pp
1118Note that by default
1119.Xr sshd 8
1120will be installed so that it requires successful RSA host
610cd5c6 1121authentication before permitting \s+2.\s0rhosts authentication.
1122If your server machine does not have the client's host key in
5f4fdfae 1123.Pa /etc/ssh_known_hosts ,
bf740959 1124you can store it in
1125.Pa $HOME/.ssh/known_hosts .
1126The easiest way to do this is to
1127connect back to the client from the server machine using ssh; this
1d1ffb87 1128will automatically add the host key to
bf740959 1129.Pa $HOME/.ssh/known_hosts .
1130.It Pa $HOME/.shosts
1131This file is used exactly the same way as
1132.Pa \&.rhosts .
1133The purpose for
1134having this file is to be able to use rhosts authentication with
1135.Nm
1136without permitting login with
1137.Xr rlogin 1
1138or
1139.Xr rsh 1 .
1140.It Pa /etc/hosts.equiv
1141This file is used during
610cd5c6 1142.Pa \&.rhosts authentication.
1143It contains
bf740959 1144canonical hosts names, one per line (the full format is described on
1145the
1146.Xr sshd 8
610cd5c6 1147manual page).
1148If the client host is found in this file, login is
bf740959 1149automatically permitted provided client and server user names are the
610cd5c6 1150same.
1151Additionally, successful RSA host authentication is normally
1152required.
1153This file should only be writable by root.
5f4fdfae 1154.It Pa /etc/shosts.equiv
f54651ce 1155This file is processed exactly as
bf740959 1156.Pa /etc/hosts.equiv .
1157This file may be useful to permit logins using
1158.Nm
1159but not using rsh/rlogin.
5f4fdfae 1160.It Pa /etc/sshrc
bf740959 1161Commands in this file are executed by
1162.Nm
1163when the user logs in just before the user's shell (or command) is started.
1164See the
1165.Xr sshd 8
1166manual page for more information.
1167.It Pa $HOME/.ssh/rc
1168Commands in this file are executed by
1169.Nm
1170when the user logs in just before the user's shell (or command) is
1171started.
f54651ce 1172See the
bf740959 1173.Xr sshd 8
1174manual page for more information.
83b7f649 1175.It Pa $HOME/.ssh/environment
1176Contains additional definitions for environment variables, see section
1177.Sx ENVIRONMENT
1178above.
bf740959 1179.It Pa libcrypto.so.X.1
1180A version of this library which includes support for the RSA algorithm
1181is required for proper operation.
1182.Sh AUTHOR
bf740959 1183OpenSSH
c8d54615 1184is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
610cd5c6 1185but with bugs removed and newer features re-added.
1186Rapidly after the
c8d54615 11871.2.12 release, newer versions of the original ssh bore successively
1188more restrictive licenses, and thus demand for a free version was born.
1d1ffb87 1189.Pp
c8d54615 1190This version of OpenSSH
bf740959 1191.Bl -bullet
1192.It
371ecff9 1193has all components of a restrictive nature (i.e., patents)
bf740959 1194directly removed from the source code; any licensed or patented components
1195are chosen from
1196external libraries.
1197.It
1d1ffb87 1198has been updated to support SSH protocol 1.5 and 2, making it compatible with
1199all other SSH clients and servers.
bf740959 1200.It
f54651ce 1201contains added support for
bf740959 1202.Xr kerberos 8
1203authentication and ticket passing.
1204.It
1205supports one-time password authentication with
1206.Xr skey 1 .
1207.El
1208.Pp
0c16a097 1209OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
f095fcc7 1210Niels Provos, Theo de Raadt, and Dug Song.
1d1ffb87 1211.Pp
1212The support for SSH protocol 2 was written by Markus Friedl.
bf740959 1213.Sh SEE ALSO
1214.Xr rlogin 1 ,
1215.Xr rsh 1 ,
1216.Xr scp 1 ,
1217.Xr ssh-add 1 ,
1218.Xr ssh-agent 1 ,
1219.Xr ssh-keygen 1 ,
1220.Xr telnet 1 ,
1221.Xr sshd 8 ,
This page took 0.25026 seconds and 5 git commands to generate.