]> andersk Git - openssh.git/blame - ssh.1
- stevesk@cvs.openbsd.org 2001/08/29 23:02:21
[openssh.git] / ssh.1
CommitLineData
bf740959 1.\" -*- nroff -*-
2.\"
bf740959 3.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
bf740959 4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5.\" All rights reserved
6.\"
bcbf86ec 7.\" As far as I am concerned, the code I have written for this software
8.\" can be used freely for any purpose. Any derived versions of this
9.\" software must be clearly marked as such, and if the derived work is
10.\" incompatible with the protocol description in the RFC file, it must be
11.\" called by a name other than "ssh" or "Secure Shell".
12.\"
f3c7c613 13.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
14.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
15.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
bcbf86ec 16.\"
17.\" Redistribution and use in source and binary forms, with or without
18.\" modification, are permitted provided that the following conditions
19.\" are met:
20.\" 1. Redistributions of source code must retain the above copyright
21.\" notice, this list of conditions and the following disclaimer.
22.\" 2. Redistributions in binary form must reproduce the above copyright
23.\" notice, this list of conditions and the following disclaimer in the
24.\" documentation and/or other materials provided with the distribution.
bf740959 25.\"
bcbf86ec 26.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
bf740959 36.\"
e591b98a 37.\" $OpenBSD: ssh.1,v 1.132 2001/08/28 15:39:48 markus Exp $
bf740959 38.Dd September 25, 1999
39.Dt SSH 1
40.Os
41.Sh NAME
42.Nm ssh
2c86906e 43.Nd OpenSSH SSH client (remote login program)
bf740959 44.Sh SYNOPSIS
45.Nm ssh
46.Op Fl l Ar login_name
c78e5800 47.Ar hostname | user@hostname
bf740959 48.Op Ar command
49.Pp
50.Nm ssh
9afadca8 51.Op Fl afgknqstvxACNPTX1246
3435f5a6 52.Op Fl b Ar bind_address
d0c832f3 53.Op Fl c Ar cipher_spec
bf740959 54.Op Fl e Ar escape_char
55.Op Fl i Ar identity_file
56.Op Fl l Ar login_name
b2552997 57.Op Fl m Ar mac_spec
bf740959 58.Op Fl o Ar option
59.Op Fl p Ar port
e591b98a 60.Op Fl F Ar configfile
bf740959 61.Oo Fl L Xo
62.Sm off
bf740959 63.Ar port :
7b2ea3a1 64.Ar host :
bf740959 65.Ar hostport
66.Sm on
67.Xc
68.Oc
69.Oo Fl R Xo
70.Sm off
bf740959 71.Ar port :
7b2ea3a1 72.Ar host :
bf740959 73.Ar hostport
74.Sm on
75.Xc
76.Oc
c78e5800 77.Ar hostname | user@hostname
bf740959 78.Op Ar command
f54651ce 79.Sh DESCRIPTION
bf740959 80.Nm
2c86906e 81(SSH client) is a program for logging into a remote machine and for
610cd5c6 82executing commands on a remote machine.
83It is intended to replace
bf740959 84rlogin and rsh, and provide secure encrypted communications between
610cd5c6 85two untrusted hosts over an insecure network.
86X11 connections and
bf740959 87arbitrary TCP/IP ports can also be forwarded over the secure channel.
88.Pp
89.Nm
f54651ce 90connects and logs into the specified
bf740959 91.Ar hostname .
92The user must prove
1d1ffb87 93his/her identity to the remote machine using one of several methods
94depending on the protocol version used:
95.Pp
96.Ss SSH protocol version 1
bf740959 97.Pp
98First, if the machine the user logs in from is listed in
99.Pa /etc/hosts.equiv
100or
5f4fdfae 101.Pa /etc/shosts.equiv
bf740959 102on the remote machine, and the user names are
103the same on both sides, the user is immediately permitted to log in.
f54651ce 104Second, if
bf740959 105.Pa \&.rhosts
106or
107.Pa \&.shosts
108exists in the user's home directory on the
109remote machine and contains a line containing the name of the client
110machine and the name of the user on that machine, the user is
610cd5c6 111permitted to log in.
112This form of authentication alone is normally not
bf740959 113allowed by the server because it is not secure.
114.Pp
da89cf4d 115The second authentication method is the
bf740959 116.Pa rhosts
117or
118.Pa hosts.equiv
610cd5c6 119method combined with RSA-based host authentication.
120It means that if the login would be permitted by
1d1ffb87 121.Pa $HOME/.rhosts ,
122.Pa $HOME/.shosts ,
bf740959 123.Pa /etc/hosts.equiv ,
124or
5f4fdfae 125.Pa /etc/shosts.equiv ,
bf740959 126and if additionally the server can verify the client's
f54651ce 127host key (see
5f4fdfae 128.Pa /etc/ssh_known_hosts
5bbb5681 129and
130.Pa $HOME/.ssh/known_hosts
bf740959 131in the
132.Sx FILES
610cd5c6 133section), only then login is permitted.
134This authentication method closes security holes due to IP
135spoofing, DNS spoofing and routing spoofing.
136[Note to the administrator:
bf740959 137.Pa /etc/hosts.equiv ,
1d1ffb87 138.Pa $HOME/.rhosts ,
bf740959 139and the rlogin/rsh protocol in general, are inherently insecure and should be
140disabled if security is desired.]
141.Pp
f54651ce 142As a third authentication method,
bf740959 143.Nm
144supports RSA based authentication.
145The scheme is based on public-key cryptography: there are cryptosystems
146where encryption and decryption are done using separate keys, and it
147is not possible to derive the decryption key from the encryption key.
610cd5c6 148RSA is one such system.
f54651ce 149The idea is that each user creates a public/private
610cd5c6 150key pair for authentication purposes.
151The server knows the public key, and only the user knows the private key.
f54651ce 152The file
bf740959 153.Pa $HOME/.ssh/authorized_keys
154lists the public keys that are permitted for logging
610cd5c6 155in.
156When the user logs in, the
bf740959 157.Nm
158program tells the server which key pair it would like to use for
610cd5c6 159authentication.
160The server checks if this key is permitted, and if
bf740959 161so, sends the user (actually the
162.Nm
163program running on behalf of the user) a challenge, a random number,
610cd5c6 164encrypted by the user's public key.
165The challenge can only be
166decrypted using the proper private key.
167The user's client then decrypts the
bf740959 168challenge using the private key, proving that he/she knows the private
169key but without disclosing it to the server.
170.Pp
171.Nm
610cd5c6 172implements the RSA authentication protocol automatically.
173The user creates his/her RSA key pair by running
bf740959 174.Xr ssh-keygen 1 .
f54651ce 175This stores the private key in
1d1ffb87 176.Pa $HOME/.ssh/identity
bf740959 177and the public key in
1d1ffb87 178.Pa $HOME/.ssh/identity.pub
610cd5c6 179in the user's home directory.
180The user should then copy the
bf740959 181.Pa identity.pub
f54651ce 182to
1d1ffb87 183.Pa $HOME/.ssh/authorized_keys
f54651ce 184in his/her home directory on the remote machine (the
bf740959 185.Pa authorized_keys
f54651ce 186file corresponds to the conventional
1d1ffb87 187.Pa $HOME/.rhosts
bf740959 188file, and has one key
610cd5c6 189per line, though the lines can be very long).
190After this, the user can log in without giving the password.
191RSA authentication is much
bf740959 192more secure than rhosts authentication.
193.Pp
194The most convenient way to use RSA authentication may be with an
610cd5c6 195authentication agent.
196See
bf740959 197.Xr ssh-agent 1
198for more information.
199.Pp
f54651ce 200If other authentication methods fail,
bf740959 201.Nm
610cd5c6 202prompts the user for a password.
203The password is sent to the remote
bf740959 204host for checking; however, since all communications are encrypted,
205the password cannot be seen by someone listening on the network.
206.Pp
1d1ffb87 207.Ss SSH protocol version 2
208.Pp
209When a user connects using the protocol version 2
da89cf4d 210different authentication methods are available.
211Using the default values for
212.Cm PreferredAuthentications ,
29c440a0 213the client will try to authenticate first using the hostbased method;
214if this method fails public key authentication is attempted,
215and finally if this method fails keyboard-interactive and
216password authentication are tried.
1d1ffb87 217.Pp
218The public key method is similar to RSA authentication described
da89cf4d 219in the previous section and allows the RSA or DSA algorithm to be used:
c0ecc314 220The client uses his private key,
1d1ffb87 221.Pa $HOME/.ssh/id_dsa
c0ecc314 222or
223.Pa $HOME/.ssh/id_rsa ,
1d1ffb87 224to sign the session identifier and sends the result to the server.
225The server checks whether the matching public key is listed in
96a7b0cc 226.Pa $HOME/.ssh/authorized_keys
1d1ffb87 227and grants access if both the key is found and the signature is correct.
228The session identifier is derived from a shared Diffie-Hellman value
229and is only known to the client and the server.
230.Pp
231If public key authentication fails or is not available a password
232can be sent encrypted to the remote host for proving the user's identity.
da89cf4d 233.Pp
234Additionally,
235.Nm
236supports hostbased or challenge response authentication.
1d1ffb87 237.Pp
238Protocol 2 provides additional mechanisms for confidentiality
d0c832f3 239(the traffic is encrypted using 3DES, Blowfish, CAST128 or Arcfour)
f2ba0775 240and integrity (hmac-md5, hmac-sha1).
1d1ffb87 241Note that protocol 1 lacks a strong mechanism for ensuring the
242integrity of the connection.
243.Pp
244.Ss Login session and remote execution
245.Pp
bf740959 246When the user's identity has been accepted by the server, the server
247either executes the given command, or logs into the machine and gives
610cd5c6 248the user a normal shell on the remote machine.
249All communication with
bf740959 250the remote command or shell will be automatically encrypted.
251.Pp
252If a pseudo-terminal has been allocated (normal login session), the
df841692 253user may use the escape characters noted below.
bf740959 254.Pp
255If no pseudo tty has been allocated, the
256session is transparent and can be used to reliably transfer binary
610cd5c6 257data.
258On most systems, setting the escape character to
bf740959 259.Dq none
260will also make the session transparent even if a tty is used.
261.Pp
ce9c0b75 262The session terminates when the command or shell on the remote
e91c60f2 263machine exits and all X11 and TCP/IP connections have been closed.
bf740959 264The exit status of the remote program is returned as the exit status
265of
266.Nm ssh .
267.Pp
df841692 268.Ss Escape Characters
269.Pp
270When a pseudo terminal has been requested, ssh supports a number of functions
3730bb22 271through the use of an escape character.
df841692 272.Pp
273A single tilde character can be sent as
274.Ic ~~
5bef3c35 275or by following the tilde by a character other than those described below.
df841692 276The escape character must always follow a newline to be interpreted as
277special.
278The escape character can be changed in configuration files using the
279.Cm EscapeChar
3730bb22 280configuration directive or on the command line by the
df841692 281.Fl e
282option.
283.Pp
284The supported escapes (assuming the default
285.Ql ~ )
286are:
287.Bl -tag -width Ds
288.It Cm ~.
289Disconnect
290.It Cm ~^Z
291Background ssh
292.It Cm ~#
293List forwarded connections
294.It Cm ~&
295Background ssh at logout when waiting for forwarded connection / X11 sessions
da89cf4d 296to terminate (protocol version 1 only)
df841692 297.It Cm ~?
298Display a list of escape characters
299.It Cm ~R
67b964a1 300Request rekeying of the connection (only useful for SSH protocol version 2
301and if the peer supports it)
df841692 302.El
303.Pp
1d1ffb87 304.Ss X11 and TCP forwarding
305.Pp
6efa3d14 306If the
307.Cm ForwardX11
308variable is set to
309.Dq yes
310(or, see the description of the
311.Fl X
312and
313.Fl x
314options described later)
315and the user is using X11 (the
bf740959 316.Ev DISPLAY
317environment variable is set), the connection to the X11 display is
318automatically forwarded to the remote side in such a way that any X11
319programs started from the shell (or command) will go through the
320encrypted channel, and the connection to the real X server will be made
610cd5c6 321from the local machine.
322The user should not manually set
bf740959 323.Ev DISPLAY .
324Forwarding of X11 connections can be
325configured on the command line or in configuration files.
326.Pp
327The
f54651ce 328.Ev DISPLAY
bf740959 329value set by
330.Nm
331will point to the server machine, but with a display number greater
610cd5c6 332than zero.
333This is normal, and happens because
bf740959 334.Nm
335creates a
336.Dq proxy
337X server on the server machine for forwarding the
338connections over the encrypted channel.
339.Pp
340.Nm
341will also automatically set up Xauthority data on the server machine.
342For this purpose, it will generate a random authorization cookie,
343store it in Xauthority on the server, and verify that any forwarded
344connections carry this cookie and replace it by the real cookie when
610cd5c6 345the connection is opened.
346The real authentication cookie is never
bf740959 347sent to the server machine (and no cookies are sent in the plain).
348.Pp
349If the user is using an authentication agent, the connection to the agent
350is automatically forwarded to the remote side unless disabled on
491f5f7b 351the command line or in a configuration file.
bf740959 352.Pp
353Forwarding of arbitrary TCP/IP connections over the secure channel can
491f5f7b 354be specified either on the command line or in a configuration file.
610cd5c6 355One possible application of TCP/IP forwarding is a secure connection to an
e91c60f2 356electronic purse; another is going through firewalls.
bf740959 357.Pp
1d1ffb87 358.Ss Server authentication
359.Pp
bf740959 360.Nm
1d1ffb87 361automatically maintains and checks a database containing
610cd5c6 362identifications for all hosts it has ever been used with.
f49bc4f7 363Host keys are stored in
1d1ffb87 364.Pa $HOME/.ssh/known_hosts
610cd5c6 365in the user's home directory.
f49bc4f7 366Additionally, the file
5f4fdfae 367.Pa /etc/ssh_known_hosts
f49bc4f7 368is automatically checked for known hosts.
610cd5c6 369Any new hosts are automatically added to the user's file.
370If a host's identification
bf740959 371ever changes,
372.Nm
373warns about this and disables password authentication to prevent a
610cd5c6 374trojan horse from getting the user's password.
375Another purpose of
bf740959 376this mechanism is to prevent man-in-the-middle attacks which could
610cd5c6 377otherwise be used to circumvent the encryption.
378The
bf740959 379.Cm StrictHostKeyChecking
380option (see below) can be used to prevent logins to machines whose
381host key is not known or has changed.
fa08c86b 382.Pp
383The options are as follows:
bf740959 384.Bl -tag -width Ds
385.It Fl a
4fe2af09 386Disables forwarding of the authentication agent connection.
71276795 387.It Fl A
388Enables forwarding of the authentication agent connection.
389This can also be specified on a per-host basis in a configuration file.
3435f5a6 390.It Fl b Ar bind_address
391Specify the interface to transmit from on machines with multiple
392interfaces or aliased addresses.
29999e54 393.It Fl c Ar blowfish|3des|des
f54651ce 394Selects the cipher to use for encrypting the session.
bf740959 395.Ar 3des
610cd5c6 396is used by default.
f54651ce 397It is believed to be secure.
bf740959 398.Ar 3des
399(triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
bf740959 400.Ar blowfish
401is a fast block cipher, it appears very secure and is much faster than
610cd5c6 402.Ar 3des .
29999e54 403.Ar des
404is only supported in the
405.Nm
406client for interoperability with legacy protocol 1 implementations
407that do not support the
408.Ar 3des
409cipher. Its use is strongly discouraged due to cryptographic
410weaknesses.
9afadca8 411.It Fl c Ar cipher_spec
d0c832f3 412Additionally, for protocol version 2 a comma-separated list of ciphers can
94ec8c6b 413be specified in order of preference.
9afadca8 414See
415.Cm Ciphers
416for more information.
bf740959 417.It Fl e Ar ch|^ch|none
418Sets the escape character for sessions with a pty (default:
419.Ql ~ ) .
610cd5c6 420The escape character is only recognized at the beginning of a line.
421The escape character followed by a dot
bf740959 422.Pq Ql \&.
423closes the connection, followed
424by control-Z suspends the connection, and followed by itself sends the
610cd5c6 425escape character once.
426Setting the character to
bf740959 427.Dq none
428disables any escapes and makes the session fully transparent.
429.It Fl f
430Requests
431.Nm
610cd5c6 432to go to background just before command execution.
433This is useful if
bf740959 434.Nm
435is going to ask for passwords or passphrases, but the user
610cd5c6 436wants it in the background.
f54651ce 437This implies
bf740959 438.Fl n .
439The recommended way to start X11 programs at a remote site is with
440something like
441.Ic ssh -f host xterm .
7b2ea3a1 442.It Fl g
443Allows remote hosts to connect to local forwarded ports.
bf740959 444.It Fl i Ar identity_file
f54651ce 445Selects the file from which the identity (private key) for
fa08c86b 446RSA or DSA authentication is read.
f54651ce 447Default is
1d1ffb87 448.Pa $HOME/.ssh/identity
610cd5c6 449in the user's home directory.
450Identity files may also be specified on
451a per-host basis in the configuration file.
452It is possible to have multiple
bf740959 453.Fl i
454options (and multiple identities specified in
455configuration files).
eea098a3 456.It Fl I Ar smartcard_device
457Specifies which smartcard device to use. The argument is
458the device
459.Nm
460should use to communicate with a smartcard used for storing the user's
461private RSA key.
bf740959 462.It Fl k
4fe2af09 463Disables forwarding of Kerberos tickets and AFS tokens.
464This may also be specified on a per-host basis in the configuration file.
bf740959 465.It Fl l Ar login_name
610cd5c6 466Specifies the user to log in as on the remote machine.
467This also may be specified on a per-host basis in the configuration file.
b2552997 468.It Fl m Ar mac_spec
469Additionally, for protocol version 2 a comma-separated list of MAC
470(message authentication code) algorithms can
471be specified in order of preference.
472See the
473.Cm MACs
474keyword for more information.
bf740959 475.It Fl n
476Redirects stdin from
477.Pa /dev/null
478(actually, prevents reading from stdin).
479This must be used when
480.Nm
610cd5c6 481is run in the background.
482A common trick is to use this to run X11 programs on a remote machine.
483For example,
bf740959 484.Ic ssh -n shadows.cs.hut.fi emacs &
485will start an emacs on shadows.cs.hut.fi, and the X11
486connection will be automatically forwarded over an encrypted channel.
487The
488.Nm
489program will be put in the background.
490(This does not work if
491.Nm
492needs to ask for a password or passphrase; see also the
493.Fl f
494option.)
0e73cc53 495.It Fl N
496Do not execute a remote command.
0b6fbf03 497This is useful if you just want to forward ports
0e73cc53 498(protocol version 2 only).
bf740959 499.It Fl o Ar option
38539909 500Can be used to give options in the format used in the configuration file.
bf740959 501This is useful for specifying options for which there is no separate
610cd5c6 502command-line flag.
bf740959 503.It Fl p Ar port
610cd5c6 504Port to connect to on the remote host.
505This can be specified on a
bf740959 506per-host basis in the configuration file.
507.It Fl P
508Use a non-privileged port for outgoing connections.
509This can be used if your firewall does
510not permit connections from privileged ports.
95f1eccc 511Note that this option turns off
bf740959 512.Cm RhostsAuthentication
513and
6ffc9c88 514.Cm RhostsRSAAuthentication
515for older servers.
bf740959 516.It Fl q
610cd5c6 517Quiet mode.
518Causes all warning and diagnostic messages to be suppressed.
519Only fatal errors are displayed.
ae810de7 520.It Fl s
3730bb22 521May be used to request invocation of a subsystem on the remote system. Subsystems are a feature of the SSH2 protocol which facilitate the use
522of SSH as a secure transport for other applications (eg. sftp). The
ae810de7 523subsystem is specified as the remote command.
bf740959 524.It Fl t
610cd5c6 525Force pseudo-tty allocation.
4fe2af09 526This can be used to execute arbitrary
610cd5c6 527screen-based programs on a remote machine, which can be very useful,
528e.g., when implementing menu services.
8abcdba4 529Multiple
530.Fl t
531options force tty allocation, even if
532.Nm
533has no local tty.
0e73cc53 534.It Fl T
0b6fbf03 535Disable pseudo-tty allocation.
bf740959 536.It Fl v
610cd5c6 537Verbose mode.
538Causes
bf740959 539.Nm
610cd5c6 540to print debugging messages about its progress.
541This is helpful in
bf740959 542debugging connection, authentication, and configuration problems.
8abcdba4 543Multiple
544.Fl v
545options increases the verbosity.
94ec8c6b 546Maximum is 3.
bf740959 547.It Fl x
610cd5c6 548Disables X11 forwarding.
bf740959 549.It Fl X
550Enables X11 forwarding.
71276795 551This can also be specified on a per-host basis in a configuration file.
bf740959 552.It Fl C
553Requests compression of all data (including stdin, stdout, stderr, and
610cd5c6 554data for forwarded X11 and TCP/IP connections).
555The compression algorithm is the same used by
7b2ea3a1 556.Xr gzip 1 ,
557and the
bf740959 558.Dq level
559can be controlled by the
560.Cm CompressionLevel
610cd5c6 561option (see below).
562Compression is desirable on modem lines and other
bf740959 563slow connections, but will only slow down things on fast networks.
564The default value can be set on a host-by-host basis in the
565configuration files; see the
0aea6c59 566.Cm Compression
bf740959 567option below.
e591b98a 568.It Fl F Ar configfile
569Specifies an alternative per-user configuration file.
570If a configuration file is given on the command line,
571the system-wide configuration file
572.Pq Pa /etc/ssh_config
573will be ignored.
574The default for the per-user configuration file is
575.Pa $HOME/.ssh/config .
bf740959 576.It Fl L Ar port:host:hostport
577Specifies that the given port on the local (client) host is to be
610cd5c6 578forwarded to the given host and port on the remote side.
579This works by allocating a socket to listen to
bf740959 580.Ar port
581on the local side, and whenever a connection is made to this port, the
582connection is forwarded over the secure channel, and a connection is
583made to
48e671d5 584.Ar host
585port
586.Ar hostport
610cd5c6 587from the remote machine.
588Port forwardings can also be specified in the configuration file.
589Only root can forward privileged ports.
48e671d5 590IPv6 addresses can be specified with an alternative syntax:
591.Ar port/host/hostport
bf740959 592.It Fl R Ar port:host:hostport
593Specifies that the given port on the remote (server) host is to be
610cd5c6 594forwarded to the given host and port on the local side.
595This works by allocating a socket to listen to
bf740959 596.Ar port
597on the remote side, and whenever a connection is made to this port, the
598connection is forwarded over the secure channel, and a connection is
599made to
48e671d5 600.Ar host
601port
602.Ar hostport
610cd5c6 603from the local machine.
604Port forwardings can also be specified in the configuration file.
605Privileged ports can be forwarded only when
bf740959 606logging in as root on the remote machine.
da89cf4d 607IPv6 addresses can be specified with an alternative syntax:
608.Ar port/host/hostport
9afadca8 609.It Fl 1
610Forces
611.Nm
612to try protocol version 1 only.
6ae2364d 613.It Fl 2
614Forces
615.Nm
1d1ffb87 616to try protocol version 2 only.
48e671d5 617.It Fl 4
618Forces
619.Nm
620to use IPv4 addresses only.
621.It Fl 6
622Forces
623.Nm
624to use IPv6 addresses only.
bf740959 625.El
626.Sh CONFIGURATION FILES
627.Nm
38539909 628obtains configuration data from the following sources in
629the following order:
bf740959 630command line options, user's configuration file
631.Pq Pa $HOME/.ssh/config ,
632and system-wide configuration file
5f4fdfae 633.Pq Pa /etc/ssh_config .
bf740959 634For each parameter, the first obtained value
610cd5c6 635will be used.
636The configuration files contain sections bracketed by
637.Dq Host
638specifications, and that section is only applied for hosts that
639match one of the patterns given in the specification.
640The matched host name is the one given on the command line.
bf740959 641.Pp
642Since the first obtained value for each parameter is used, more
643host-specific declarations should be given near the beginning of the
644file, and general defaults at the end.
645.Pp
646The configuration file has the following format:
647.Pp
648Empty lines and lines starting with
649.Ql #
650are comments.
651.Pp
652Otherwise a line is of the format
653.Dq keyword arguments .
38539909 654Configuration options may be separated by whitespace or
655optional whitespace and exactly one
656.Ql = ;
657the latter format is useful to avoid the need to quote whitespace
658when specifying configuration options using the
659.Nm ssh ,
660.Nm scp
661and
662.Nm sftp
663.Fl o
664option.
665.Pp
bf740959 666The possible
54bf768d 667keywords and their meanings are as follows (note that
668keywords are case-insensitive and arguments are case-sensitive):
bf740959 669.Bl -tag -width Ds
670.It Cm Host
671Restricts the following declarations (up to the next
672.Cm Host
673keyword) to be only for those hosts that match one of the patterns
674given after the keyword.
675.Ql \&*
676and
677.Ql ?
678can be used as wildcards in the
610cd5c6 679patterns.
680A single
bf740959 681.Ql \&*
682as a pattern can be used to provide global
610cd5c6 683defaults for all hosts.
684The host is the
bf740959 685.Ar hostname
686argument given on the command line (i.e., the name is not converted to
687a canonicalized host name before matching).
688.It Cm AFSTokenPassing
4fe2af09 689Specifies whether to pass AFS tokens to remote host.
690The argument to this keyword must be
bf740959 691.Dq yes
692or
693.Dq no .
da89cf4d 694This option applies to protocol version 1 only.
bf740959 695.It Cm BatchMode
696If set to
697.Dq yes ,
610cd5c6 698passphrase/password querying will be disabled.
699This option is useful in scripts and other batch jobs where you have no
700user to supply the password.
701The argument must be
bf740959 702.Dq yes
703or
704.Dq no .
01ce749f 705The default is
706.Dq no .
3435f5a6 707.It Cm BindAddress
708Specify the interface to transmit from on machines with multiple
709interfaces or aliased addresses.
710Note that this option does not work if
711.Cm UsePrivilegedPort
712is set to
713.Dq yes .
7b2ea3a1 714.It Cm CheckHostIP
715If this flag is set to
716.Dq yes ,
01ce749f 717ssh will additionally check the host IP address in the
7b2ea3a1 718.Pa known_hosts
4fe2af09 719file.
720This allows ssh to detect if a host key changed due to DNS spoofing.
7b2ea3a1 721If the option is set to
722.Dq no ,
723the check will not be executed.
01ce749f 724The default is
725.Dq yes .
bf740959 726.It Cm Cipher
33de75a3 727Specifies the cipher to use for encrypting the session
a22aff1f 728in protocol version 1.
610cd5c6 729Currently,
29999e54 730.Dq blowfish ,
731.Dq 3des ,
bf740959 732and
29999e54 733.Dq des
610cd5c6 734are supported.
29999e54 735.Ar des
736is only supported in the
737.Nm
738client for interoperability with legacy protocol 1 implementations
739that do not support the
740.Ar 3des
741cipher. Its use is strongly discouraged due to cryptographic
742weaknesses.
610cd5c6 743The default is
bf740959 744.Dq 3des .
f54651ce 745.It Cm Ciphers
746Specifies the ciphers allowed for protocol version 2
747in order of preference.
748Multiple ciphers must be comma-separated.
749The default is
9afadca8 750.Pp
751.Bd -literal
f2ba0775 752 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
da89cf4d 753 aes192-cbc,aes256-cbc''
9afadca8 754.Ed
bf740959 755.It Cm Compression
610cd5c6 756Specifies whether to use compression.
757The argument must be
bf740959 758.Dq yes
759or
760.Dq no .
01ce749f 761The default is
762.Dq no .
bf740959 763.It Cm CompressionLevel
01ce749f 764Specifies the compression level to use if compression is enabled.
610cd5c6 765The argument must be an integer from 1 (fast) to 9 (slow, best).
766The default level is 6, which is good for most applications.
767The meaning of the values is the same as in
7b2ea3a1 768.Xr gzip 1 .
da89cf4d 769Note that this option applies to protocol version 1 only.
bf740959 770.It Cm ConnectionAttempts
771Specifies the number of tries (one per second) to make before falling
610cd5c6 772back to rsh or exiting.
773The argument must be an integer.
774This may be useful in scripts if the connection sometimes fails.
ce773142 775The default is 1.
bf740959 776.It Cm EscapeChar
777Sets the escape character (default:
778.Ql ~ ) .
779The escape character can also
610cd5c6 780be set on the command line.
781The argument should be a single character,
bf740959 782.Ql ^
783followed by a letter, or
784.Dq none
785to disable the escape
786character entirely (making the connection transparent for binary
787data).
f54651ce 788.It Cm FallBackToRsh
bf740959 789Specifies that if connecting via
790.Nm
791fails due to a connection refused error (there is no
792.Xr sshd 8
f54651ce 793listening on the remote host),
bf740959 794.Xr rsh 1
795should automatically be used instead (after a suitable warning about
610cd5c6 796the session being unencrypted).
797The argument must be
bf740959 798.Dq yes
799or
800.Dq no .
01ce749f 801The default is
802.Dq no .
bf740959 803.It Cm ForwardAgent
804Specifies whether the connection to the authentication agent (if any)
610cd5c6 805will be forwarded to the remote machine.
806The argument must be
bf740959 807.Dq yes
808or
809.Dq no .
71276795 810The default is
811.Dq no .
bf740959 812.It Cm ForwardX11
813Specifies whether X11 connections will be automatically redirected
f54651ce 814over the secure channel and
bf740959 815.Ev DISPLAY
610cd5c6 816set.
f54651ce 817The argument must be
bf740959 818.Dq yes
819or
820.Dq no .
c8d54615 821The default is
822.Dq no .
bf740959 823.It Cm GatewayPorts
824Specifies whether remote hosts are allowed to connect to local
825forwarded ports.
826The argument must be
827.Dq yes
828or
829.Dq no .
830The default is
831.Dq no .
832.It Cm GlobalKnownHostsFile
f49bc4f7 833Specifies a file to use for the global
a5df12e9 834host key database instead of
5f4fdfae 835.Pa /etc/ssh_known_hosts .
da89cf4d 836.It Cm HostbasedAuthentication
837Specifies whether to try rhosts based authentication with public key
838authentication.
839The argument must be
840.Dq yes
841or
842.Dq no .
843The default is
3398dda9 844.Dq no .
da89cf4d 845This option applies to protocol version 2 only and
846is similar to
847.Cm RhostsRSAAuthentication .
e961a8f9 848.It Cm HostKeyAlgorithms
98143cfc 849Specifies the protocol version 2 host key algorithms
e961a8f9 850that the client wants to use in order of preference.
851The default for this option is:
852.Dq ssh-rsa,ssh-dss
da89cf4d 853.It Cm HostKeyAlias
854Specifies an alias that should be used instead of the
855real host name when looking up or saving the host key
856in the host key database files.
857This option is useful for tunneling ssh connections
858or if you have multiple servers running on a single host.
bf740959 859.It Cm HostName
610cd5c6 860Specifies the real host name to log into.
861This can be used to specify nicknames or abbreviations for hosts.
862Default is the name given on the command line.
863Numeric IP addresses are also permitted (both on the command line and in
bf740959 864.Cm HostName
865specifications).
866.It Cm IdentityFile
da89cf4d 867Specifies the file from which the user's RSA or DSA authentication identity
bf740959 868is read (default
1d1ffb87 869.Pa $HOME/.ssh/identity
bf740959 870in the user's home directory).
871Additionally, any identities represented by the authentication agent
610cd5c6 872will be used for authentication.
873The file name may use the tilde
874syntax to refer to a user's home directory.
875It is possible to have
bf740959 876multiple identity files specified in configuration files; all these
877identities will be tried in sequence.
878.It Cm KeepAlive
879Specifies whether the system should send keepalive messages to the
610cd5c6 880other side.
881If they are sent, death of the connection or crash of one
882of the machines will be properly noticed.
883However, this means that
bf740959 884connections will die if the route is down temporarily, and some people
4fe2af09 885find it annoying.
bf740959 886.Pp
887The default is
888.Dq yes
889(to send keepalives), and the client will notice
610cd5c6 890if the network goes down or the remote host dies.
891This is important in scripts, and many users want it too.
bf740959 892.Pp
893To disable keepalives, the value should be set to
894.Dq no
895in both the server and the client configuration files.
896.It Cm KerberosAuthentication
4fe2af09 897Specifies whether Kerberos authentication will be used.
898The argument to this keyword must be
bf740959 899.Dq yes
900or
901.Dq no .
902.It Cm KerberosTgtPassing
4fe2af09 903Specifies whether a Kerberos TGT will be forwarded to the server.
904This will only work if the Kerberos server is actually an AFS kaserver.
905The argument to this keyword must be
bf740959 906.Dq yes
907or
908.Dq no .
909.It Cm LocalForward
910Specifies that a TCP/IP port on the local machine be forwarded over
610cd5c6 911the secure channel to given host:port from the remote machine.
912The first argument must be a port number, and the second must be
913host:port.
914Multiple forwardings may be specified, and additional
915forwardings can be given on the command line.
916Only the superuser can forward privileged ports.
6a17f9c2 917.It Cm LogLevel
918Gives the verbosity level that is used when logging messages from
919.Nm ssh .
920The possible values are:
59c97189 921QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
922The default is INFO.
b2552997 923.It Cm MACs
3730bb22 924Specifies the MAC (message authentication code) algorithms
b2552997 925in order of preference.
926The MAC algorithm is used in protocol version 2
927for data integrity protection.
928Multiple algorithms must be comma-separated.
929The default is
47bf6266 930.Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
bf740959 931.It Cm NumberOfPasswordPrompts
4fe2af09 932Specifies the number of password prompts before giving up.
933The argument to this keyword must be an integer.
934Default is 3.
7b2ea3a1 935.It Cm PasswordAuthentication
610cd5c6 936Specifies whether to use password authentication.
937The argument to this keyword must be
7b2ea3a1 938.Dq yes
939or
940.Dq no .
01ce749f 941The default is
942.Dq yes .
bf740959 943.It Cm Port
610cd5c6 944Specifies the port number to connect on the remote host.
945Default is 22.
babd91d4 946.It Cm PreferredAuthentications
3730bb22 947Specifies the order in which the client should try protocol 2
948authentication methods. This allows a client to prefer one method (e.g.
babd91d4 949.Cm keyboard-interactive )
950over another method (e.g.
951.Cm password )
952The default for this option is:
29c440a0 953.Dq hostbased,publickey,keyboard-interactive,password
f54651ce 954.It Cm Protocol
955Specifies the protocol versions
956.Nm
957should support in order of preference.
958The possible values are
959.Dq 1
960and
961.Dq 2 .
962Multiple versions must be comma-separated.
963The default is
b4a19d21 964.Dq 2,1 .
1d1ffb87 965This means that
966.Nm
b4a19d21 967tries version 2 and falls back to version 1
968if version 2 is not available.
bf740959 969.It Cm ProxyCommand
610cd5c6 970Specifies the command to use to connect to the server.
971The command
972string extends to the end of the line, and is executed with
973.Pa /bin/sh .
974In the command string,
975.Ql %h
976will be substituted by the host name to
977connect and
978.Ql %p
979by the port.
980The command can be basically anything,
981and should read from its standard input and write to its standard output.
982It should eventually connect an
bf740959 983.Xr sshd 8
984server running on some machine, or execute
985.Ic sshd -i
610cd5c6 986somewhere.
987Host key management will be done using the
bf740959 988HostName of the host being connected (defaulting to the name typed by
989the user).
57112b5a 990Note that
991.Cm CheckHostIP
992is not available for connects with a proxy command.
bf740959 993.Pp
da89cf4d 994.It Cm PubkeyAuthentication
995Specifies whether to try public key authentication.
996The argument to this keyword must be
997.Dq yes
998or
999.Dq no .
1000The default is
1001.Dq yes .
1002This option applies to protocol version 2 only.
bf740959 1003.It Cm RemoteForward
1004Specifies that a TCP/IP port on the remote machine be forwarded over
610cd5c6 1005the secure channel to given host:port from the local machine.
1006The first argument must be a port number, and the second must be
1007host:port.
1008Multiple forwardings may be specified, and additional
1009forwardings can be given on the command line.
1010Only the superuser can forward privileged ports.
bf740959 1011.It Cm RhostsAuthentication
610cd5c6 1012Specifies whether to try rhosts based authentication.
1013Note that this
bf740959 1014declaration only affects the client side and has no effect whatsoever
610cd5c6 1015on security.
1016Disabling rhosts authentication may reduce
bf740959 1017authentication time on slow connections when rhosts authentication is
610cd5c6 1018not used.
1019Most servers do not permit RhostsAuthentication because it
3730bb22 1020is not secure (see
a5a2da3b 1021.Cm RhostsRSAAuthentication ) .
610cd5c6 1022The argument to this keyword must be
bf740959 1023.Dq yes
1024or
1025.Dq no .
01ce749f 1026The default is
1027.Dq yes .
da89cf4d 1028This option applies to protocol version 1 only.
bf740959 1029.It Cm RhostsRSAAuthentication
1030Specifies whether to try rhosts based authentication with RSA host
610cd5c6 1031authentication.
610cd5c6 1032The argument must be
bf740959 1033.Dq yes
1034or
1035.Dq no .
01ce749f 1036The default is
1037.Dq yes .
da89cf4d 1038This option applies to protocol version 1 only.
bf740959 1039.It Cm RSAAuthentication
610cd5c6 1040Specifies whether to try RSA authentication.
1041The argument to this keyword must be
bf740959 1042.Dq yes
1043or
1044.Dq no .
1045RSA authentication will only be
1046attempted if the identity file exists, or an authentication agent is
1047running.
01ce749f 1048The default is
1049.Dq yes .
1d1ffb87 1050Note that this option applies to protocol version 1 only.
61e96248 1051.It Cm ChallengeResponseAuthentication
1052Specifies whether to use challenge response authentication.
610cd5c6 1053The argument to this keyword must be
5260325f 1054.Dq yes
1055or
1056.Dq no .
1057The default is
10a2cbef 1058.Dq yes .
eea098a3 1059.It Cm SmartcardDevice
1060Specifies which smartcard device to use. The argument to this keyword is
1061the device
1062.Nm
1063should use to communicate with a smartcard used for storing the user's
1064private RSA key. By default, no device is specified and smartcard support
1065is not activated.
bf740959 1066.It Cm StrictHostKeyChecking
1067If this flag is set to
f54651ce 1068.Dq yes ,
bf740959 1069.Nm
a877488a 1070will never automatically add host keys to the
bf740959 1071.Pa $HOME/.ssh/known_hosts
f49bc4f7 1072file, and refuses to connect to hosts whose host key has changed.
610cd5c6 1073This provides maximum protection against trojan horse attacks.
1074However, it can be somewhat annoying if you don't have good
5f4fdfae 1075.Pa /etc/ssh_known_hosts
bf740959 1076files installed and frequently
a877488a 1077connect to new hosts.
1078This option forces the user to manually
1079add all new hosts.
1080If this flag is set to
1081.Dq no ,
1082.Nm
1083will automatically add new host keys to the
1084user known hosts files.
1085If this flag is set to
1086.Dq ask ,
1087new host keys
1088will be added to the user known host files only after the user
1089has confirmed that is what they really want to do, and
1090.Nm
1091will refuse to connect to hosts whose host key has changed.
610cd5c6 1092The host keys of
a877488a 1093known hosts will be verified automatically in all cases.
610cd5c6 1094The argument must be
a877488a 1095.Dq yes ,
1096.Dq no
bf740959 1097or
a877488a 1098.Dq ask .
1099The default is
1100.Dq ask .
bf740959 1101.It Cm UsePrivilegedPort
1102Specifies whether to use a privileged port for outgoing connections.
1103The argument must be
1104.Dq yes
1105or
1106.Dq no .
1107The default is
d5ebca2b 1108.Dq no .
da89cf4d 1109Note that you need to set this option to
1110.Dq yes
1111if you want to use
bf740959 1112.Cm RhostsAuthentication
1113and
6ffc9c88 1114.Cm RhostsRSAAuthentication
da89cf4d 1115with older servers.
7b2ea3a1 1116.It Cm User
610cd5c6 1117Specifies the user to log in as.
1118This can be useful if you have a different user name on different machines.
1119This saves the trouble of
7b2ea3a1 1120having to remember to give the user name on the command line.
1121.It Cm UserKnownHostsFile
f49bc4f7 1122Specifies a file to use for the user
a5df12e9 1123host key database instead of
7b2ea3a1 1124.Pa $HOME/.ssh/known_hosts .
bf740959 1125.It Cm UseRsh
610cd5c6 1126Specifies that rlogin/rsh should be used for this host.
1127It is possible that the host does not at all support the
bf740959 1128.Nm
610cd5c6 1129protocol.
1130This causes
bf740959 1131.Nm
610cd5c6 1132to immediately execute
bf740959 1133.Xr rsh 1 .
1134All other options (except
1135.Cm HostName )
610cd5c6 1136are ignored if this has been specified.
1137The argument must be
bf740959 1138.Dq yes
1139or
1140.Dq no .
fa649821 1141.It Cm XAuthLocation
1142Specifies the location of the
1143.Xr xauth 1
1144program.
1145The default is
1146.Pa /usr/X11R6/bin/xauth .
b5e300c2 1147.El
bf740959 1148.Sh ENVIRONMENT
1149.Nm
1150will normally set the following environment variables:
1151.Bl -tag -width Ds
1152.It Ev DISPLAY
1153The
1154.Ev DISPLAY
610cd5c6 1155variable indicates the location of the X11 server.
f54651ce 1156It is automatically set by
bf740959 1157.Nm
1158to point to a value of the form
1159.Dq hostname:n
1160where hostname indicates
610cd5c6 1161the host where the shell runs, and n is an integer >= 1.
1162.Nm
1163uses this special value to forward X11 connections over the secure
1164channel.
da89cf4d 1165The user should normally not set
1166.Ev DISPLAY
1167explicitly, as that
bf740959 1168will render the X11 connection insecure (and will require the user to
1169manually copy any required authorization cookies).
1170.It Ev HOME
1171Set to the path of the user's home directory.
1172.It Ev LOGNAME
1173Synonym for
1174.Ev USER ;
1175set for compatibility with systems that use this variable.
1176.It Ev MAIL
ae897d7c 1177Set to the path of the user's mailbox.
610cd5c6 1178.It Ev PATH
bf740959 1179Set to the default
1180.Ev PATH ,
1181as specified when compiling
1182.Nm ssh .
3474b2b4 1183.It Ev SSH_ASKPASS
1184If
1185.Nm
1186needs a passphrase, it will read the passphrase from the current
1187terminal if it was run from a terminal.
1188If
1189.Nm
1190does not have a terminal associated with it but
1191.Ev DISPLAY
1192and
1193.Ev SSH_ASKPASS
1194are set, it will execute the program specified by
1195.Ev SSH_ASKPASS
1196and open an X11 window to read the passphrase.
1197This is particularly useful when calling
1198.Nm
1199from a
1200.Pa .Xsession
1201or related script.
1202(Note that on some machines it
1203may be necessary to redirect the input from
1204.Pa /dev/null
1205to make this work.)
bf740959 1206.It Ev SSH_AUTH_SOCK
ae897d7c 1207Identifies the path of a unix-domain socket used to communicate with the
bf740959 1208agent.
1209.It Ev SSH_CLIENT
610cd5c6 1210Identifies the client end of the connection.
1211The variable contains
bf740959 1212three space-separated values: client ip-address, client port number,
1213and server port number.
8abcdba4 1214.It Ev SSH_ORIGINAL_COMMAND
1215The variable contains the original command line if a forced command
1216is executed.
1217It can be used to extract the original arguments.
bf740959 1218.It Ev SSH_TTY
1219This is set to the name of the tty (path to the device) associated
610cd5c6 1220with the current shell or command.
1221If the current session has no tty,
bf740959 1222this variable is not set.
1223.It Ev TZ
1224The timezone variable is set to indicate the present timezone if it
c345cf9d 1225was set when the daemon was started (i.e., the daemon passes the value
bf740959 1226on to new connections).
1227.It Ev USER
1228Set to the name of the user logging in.
1229.El
1230.Pp
f54651ce 1231Additionally,
bf740959 1232.Nm
f54651ce 1233reads
1234.Pa $HOME/.ssh/environment ,
bf740959 1235and adds lines of the format
1236.Dq VARNAME=value
1237to the environment.
1238.Sh FILES
c8d54615 1239.Bl -tag -width Ds
f49bc4f7 1240.It Pa $HOME/.ssh/known_hosts
ae897d7c 1241Records host keys for all hosts the user has logged into that are not
bf740959 1242in
f49bc4f7 1243.Pa /etc/ssh_known_hosts .
bf740959 1244See
1245.Xr sshd 8 .
c0ecc314 1246.It Pa $HOME/.ssh/identity, $HOME/.ssh/id_dsa, $HOME/.ssh/id_rsa
1247Contains the authentication identity of the user.
1248They are for protocol 1 RSA, protocol 2 DSA, and protocol 2 RSA, respectively.
1d1ffb87 1249These files
1250contain sensitive data and should be readable by the user but not
bf740959 1251accessible by others (read/write/execute).
1252Note that
1253.Nm
1d1ffb87 1254ignores a private key file if it is accessible by others.
bf740959 1255It is possible to specify a passphrase when
1256generating the key; the passphrase will be used to encrypt the
1257sensitive part of this file using 3DES.
c0ecc314 1258.It Pa $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub, $HOME/.ssh/id_rsa.pub
bf740959 1259Contains the public key for authentication (public part of the
610cd5c6 1260identity file in human-readable form).
1d1ffb87 1261The contents of the
1262.Pa $HOME/.ssh/identity.pub
1263file should be added to
bf740959 1264.Pa $HOME/.ssh/authorized_keys
1265on all machines
c0ecc314 1266where you wish to log in using protocol version 1 RSA authentication.
1d1ffb87 1267The contents of the
1268.Pa $HOME/.ssh/id_dsa.pub
c0ecc314 1269and
1270.Pa $HOME/.ssh/id_rsa.pub
1d1ffb87 1271file should be added to
96a7b0cc 1272.Pa $HOME/.ssh/authorized_keys
1d1ffb87 1273on all machines
c0ecc314 1274where you wish to log in using protocol version 2 DSA/RSA authentication.
1d1ffb87 1275These files are not
610cd5c6 1276sensitive and can (but need not) be readable by anyone.
1d1ffb87 1277These files are
c44559d2 1278never used automatically and are not necessary; they are only provided for
bf740959 1279the convenience of the user.
1280.It Pa $HOME/.ssh/config
610cd5c6 1281This is the per-user configuration file.
1282The format of this file is described above.
1283This file is used by the
bf740959 1284.Nm
610cd5c6 1285client.
1286This file does not usually contain any sensitive information,
bf740959 1287but the recommended permissions are read/write for the user, and not
1288accessible by others.
1289.It Pa $HOME/.ssh/authorized_keys
96a7b0cc 1290Lists the public keys (RSA/DSA) that can be used for logging in as this user.
610cd5c6 1291The format of this file is described in the
bf740959 1292.Xr sshd 8
610cd5c6 1293manual page.
f49bc4f7 1294In the simplest form the format is the same as the .pub
1295identity files.
1d1ffb87 1296This file is not highly sensitive, but the recommended
1297permissions are read/write for the user, and not accessible by others.
f49bc4f7 1298.It Pa /etc/ssh_known_hosts
610cd5c6 1299Systemwide list of known host keys.
f49bc4f7 1300This file should be prepared by the
bf740959 1301system administrator to contain the public host keys of all machines in the
610cd5c6 1302organization.
1303This file should be world-readable.
1304This file contains
bf740959 1305public keys, one per line, in the following format (fields separated
f49bc4f7 1306by spaces): system name, public key and optional comment field.
610cd5c6 1307When different names are used
bf740959 1308for the same machine, all such names should be listed, separated by
610cd5c6 1309commas.
1310The format is described on the
bf740959 1311.Xr sshd 8
1312manual page.
1313.Pp
1314The canonical system name (as returned by name servers) is used by
1315.Xr sshd 8
1316to verify the client host when logging in; other names are needed because
1317.Nm
1318does not convert the user-supplied name to a canonical name before
1319checking the key, because someone with access to the name servers
1320would then be able to fool host authentication.
5f4fdfae 1321.It Pa /etc/ssh_config
610cd5c6 1322Systemwide configuration file.
1323This file provides defaults for those
bf740959 1324values that are not specified in the user's configuration file, and
610cd5c6 1325for those users who do not have a configuration file.
1326This file must be world-readable.
bf740959 1327.It Pa $HOME/.rhosts
1328This file is used in
1329.Pa \&.rhosts
1330authentication to list the
610cd5c6 1331host/user pairs that are permitted to log in.
1332(Note that this file is
bf740959 1333also used by rlogin and rsh, which makes using this file insecure.)
1334Each line of the file contains a host name (in the canonical form
1335returned by name servers), and then a user name on that host,
610cd5c6 1336separated by a space.
e91c60f2 1337On some machines this file may need to be
bf740959 1338world-readable if the user's home directory is on a NFS partition,
1339because
1340.Xr sshd 8
610cd5c6 1341reads it as root.
1342Additionally, this file must be owned by the user,
1343and must not have write permissions for anyone else.
1344The recommended
bf740959 1345permission for most machines is read/write for the user, and not
1346accessible by others.
1347.Pp
1348Note that by default
1349.Xr sshd 8
1350will be installed so that it requires successful RSA host
610cd5c6 1351authentication before permitting \s+2.\s0rhosts authentication.
1352If your server machine does not have the client's host key in
5f4fdfae 1353.Pa /etc/ssh_known_hosts ,
bf740959 1354you can store it in
1355.Pa $HOME/.ssh/known_hosts .
1356The easiest way to do this is to
1357connect back to the client from the server machine using ssh; this
1d1ffb87 1358will automatically add the host key to
bf740959 1359.Pa $HOME/.ssh/known_hosts .
1360.It Pa $HOME/.shosts
1361This file is used exactly the same way as
1362.Pa \&.rhosts .
1363The purpose for
1364having this file is to be able to use rhosts authentication with
1365.Nm
1366without permitting login with
1367.Xr rlogin 1
1368or
1369.Xr rsh 1 .
1370.It Pa /etc/hosts.equiv
1371This file is used during
610cd5c6 1372.Pa \&.rhosts authentication.
1373It contains
bf740959 1374canonical hosts names, one per line (the full format is described on
1375the
1376.Xr sshd 8
610cd5c6 1377manual page).
1378If the client host is found in this file, login is
bf740959 1379automatically permitted provided client and server user names are the
610cd5c6 1380same.
1381Additionally, successful RSA host authentication is normally
1382required.
1383This file should only be writable by root.
5f4fdfae 1384.It Pa /etc/shosts.equiv
f54651ce 1385This file is processed exactly as
bf740959 1386.Pa /etc/hosts.equiv .
1387This file may be useful to permit logins using
1388.Nm
1389but not using rsh/rlogin.
5f4fdfae 1390.It Pa /etc/sshrc
bf740959 1391Commands in this file are executed by
1392.Nm
1393when the user logs in just before the user's shell (or command) is started.
1394See the
1395.Xr sshd 8
1396manual page for more information.
1397.It Pa $HOME/.ssh/rc
1398Commands in this file are executed by
1399.Nm
1400when the user logs in just before the user's shell (or command) is
1401started.
f54651ce 1402See the
bf740959 1403.Xr sshd 8
1404manual page for more information.
83b7f649 1405.It Pa $HOME/.ssh/environment
1406Contains additional definitions for environment variables, see section
1407.Sx ENVIRONMENT
1408above.
b5e300c2 1409.El
fa08c86b 1410.Sh AUTHORS
5fb622e4 1411OpenSSH is a derivative of the original and free
1412ssh 1.2.12 release by Tatu Ylonen.
1413Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1414Theo de Raadt and Dug Song
1415removed many bugs, re-added newer features and
1416created OpenSSH.
1417Markus Friedl contributed the support for SSH
1418protocol versions 1.5 and 2.0.
bf740959 1419.Sh SEE ALSO
1420.Xr rlogin 1 ,
1421.Xr rsh 1 ,
1422.Xr scp 1 ,
61e96248 1423.Xr sftp 1 ,
bf740959 1424.Xr ssh-add 1 ,
1425.Xr ssh-agent 1 ,
1426.Xr ssh-keygen 1 ,
1427.Xr telnet 1 ,
9afadca8 1428.Xr sshd 8
2cad6cef 1429.Rs
1430.%A T. Ylonen
1431.%A T. Kivinen
1432.%A M. Saarinen
1433.%A T. Rinne
1434.%A S. Lehtinen
1435.%T "SSH Protocol Architecture"
1930af48 1436.%N draft-ietf-secsh-architecture-09.txt
1437.%D July 2001
2cad6cef 1438.%O work in progress material
1439.Re
This page took 0.361464 seconds and 5 git commands to generate.