ssh.0 revision 218769
1203945SweongyoSSH(1)                     OpenBSD Reference Manual                     SSH(1)
2203945Sweongyo
3203945SweongyoNAME
4203945Sweongyo     ssh - OpenSSH SSH client (remote login program)
5203945Sweongyo
6203945SweongyoSYNOPSIS
7203945Sweongyo     ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
8203945Sweongyo         [-D [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11]
9203945Sweongyo         [-i identity_file] [-L [bind_address:]port:host:hostport]
10203945Sweongyo         [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
11203945Sweongyo         [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
12203945Sweongyo         [-w local_tun[:remote_tun]] [user@]hostname [command]
13203945Sweongyo
14203945SweongyoDESCRIPTION
15203945Sweongyo     ssh (SSH client) is a program for logging into a remote machine and for
16203945Sweongyo     executing commands on a remote machine.  It is intended to replace rlogin
17203945Sweongyo     and rsh, and provide secure encrypted communications between two
18203945Sweongyo     untrusted hosts over an insecure network.  X11 connections and arbitrary
19203945Sweongyo     TCP ports can also be forwarded over the secure channel.
20203945Sweongyo
21203945Sweongyo     ssh connects and logs into the specified hostname (with optional user
22203945Sweongyo     name).  The user must prove his/her identity to the remote machine using
23203945Sweongyo     one of several methods depending on the protocol version used (see
24203945Sweongyo     below).
25203945Sweongyo
26203945Sweongyo     If command is specified, it is executed on the remote host instead of a
27203945Sweongyo     login shell.
28203945Sweongyo
29203945Sweongyo     The options are as follows:
30203945Sweongyo
31203945Sweongyo     -1      Forces ssh to try protocol version 1 only.
32203945Sweongyo
33203945Sweongyo     -2      Forces ssh to try protocol version 2 only.
34203945Sweongyo
35203945Sweongyo     -4      Forces ssh to use IPv4 addresses only.
36203945Sweongyo
37203945Sweongyo     -6      Forces ssh to use IPv6 addresses only.
38203945Sweongyo
39203945Sweongyo     -A      Enables forwarding of the authentication agent connection.  This
40203945Sweongyo             can also be specified on a per-host basis in a configuration
41203945Sweongyo             file.
42203945Sweongyo
43203945Sweongyo             Agent forwarding should be enabled with caution.  Users with the
44203945Sweongyo             ability to bypass file permissions on the remote host (for the
45203945Sweongyo             agent's UNIX-domain socket) can access the local agent through
46203945Sweongyo             the forwarded connection.  An attacker cannot obtain key material
47203945Sweongyo             from the agent, however they can perform operations on the keys
48203945Sweongyo             that enable them to authenticate using the identities loaded into
49203945Sweongyo             the agent.
50203945Sweongyo
51203945Sweongyo     -a      Disables forwarding of the authentication agent connection.
52203945Sweongyo
53203945Sweongyo     -b bind_address
54203945Sweongyo             Use bind_address on the local machine as the source address of
55203945Sweongyo             the connection.  Only useful on systems with more than one
56203945Sweongyo             address.
57203945Sweongyo
58203945Sweongyo     -C      Requests compression of all data (including stdin, stdout,
59203945Sweongyo             stderr, and data for forwarded X11 and TCP connections).  The
60203945Sweongyo             compression algorithm is the same used by gzip(1), and the
61203945Sweongyo             ``level'' can be controlled by the CompressionLevel option for
62203945Sweongyo             protocol version 1.  Compression is desirable on modem lines and
63203945Sweongyo             other slow connections, but will only slow down things on fast
64203945Sweongyo             networks.  The default value can be set on a host-by-host basis
65203945Sweongyo             in the configuration files; see the Compression option.
66203945Sweongyo
67203945Sweongyo     -c cipher_spec
68203945Sweongyo             Selects the cipher specification for encrypting the session.
69203945Sweongyo
70203945Sweongyo             Protocol version 1 allows specification of a single cipher.  The
71206358Srpaulo             supported values are ``3des'', ``blowfish'', and ``des''.  3des
72203945Sweongyo             (triple-des) is an encrypt-decrypt-encrypt triple with three
73203945Sweongyo             different keys.  It is believed to be secure.  blowfish is a fast
74203945Sweongyo             block cipher; it appears very secure and is much faster than
75203945Sweongyo             3des.  des is only supported in the ssh client for
76227309Sed             interoperability with legacy protocol 1 implementations that do
77227309Sed             not support the 3des cipher.  Its use is strongly discouraged due
78203945Sweongyo             to cryptographic weaknesses.  The default is ``3des''.
79203945Sweongyo
80203945Sweongyo             For protocol version 2, cipher_spec is a comma-separated list of
81203945Sweongyo             ciphers listed in order of preference.  See the Ciphers keyword
82203945Sweongyo             in ssh_config(5) for more information.
83203945Sweongyo
84203945Sweongyo     -D [bind_address:]port
85203945Sweongyo             Specifies a local ``dynamic'' application-level port forwarding.
86203945Sweongyo             This works by allocating a socket to listen to port on the local
87203945Sweongyo             side, optionally bound to the specified bind_address.  Whenever a
88203945Sweongyo             connection is made to this port, the connection is forwarded over
89203945Sweongyo             the secure channel, and the application protocol is then used to
90203945Sweongyo             determine where to connect to from the remote machine.  Currently
91203945Sweongyo             the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
92203945Sweongyo             as a SOCKS server.  Only root can forward privileged ports.
93203945Sweongyo             Dynamic port forwardings can also be specified in the
94203945Sweongyo             configuration file.
95203945Sweongyo
96203945Sweongyo             IPv6 addresses can be specified by enclosing the address in
97203945Sweongyo             square brackets.  Only the superuser can forward privileged
98203945Sweongyo             ports.  By default, the local port is bound in accordance with
99203945Sweongyo             the GatewayPorts setting.  However, an explicit bind_address may
100203945Sweongyo             be used to bind the connection to a specific address.  The
101203945Sweongyo             bind_address of ``localhost'' indicates that the listening port
102203945Sweongyo             be bound for local use only, while an empty address or `*'
103203945Sweongyo             indicates that the port should be available from all interfaces.
104203945Sweongyo
105203945Sweongyo     -e escape_char
106203945Sweongyo             Sets the escape character for sessions with a pty (default: `~').
107203945Sweongyo             The escape character is only recognized at the beginning of a
108203945Sweongyo             line.  The escape character followed by a dot (`.') closes the
109203945Sweongyo             connection; followed by control-Z suspends the connection; and
110203945Sweongyo             followed by itself sends the escape character once.  Setting the
111203945Sweongyo             character to ``none'' disables any escapes and makes the session
112203945Sweongyo             fully transparent.
113203945Sweongyo
114203945Sweongyo     -F configfile
115203945Sweongyo             Specifies an alternative per-user configuration file.  If a
116203945Sweongyo             configuration file is given on the command line, the system-wide
117203945Sweongyo             configuration file (/etc/ssh/ssh_config) will be ignored.  The
118203945Sweongyo             default for the per-user configuration file is ~/.ssh/config.
119203945Sweongyo
120203945Sweongyo     -f      Requests ssh to go to background just before command execution.
121203945Sweongyo             This is useful if ssh is going to ask for passwords or
122203945Sweongyo             passphrases, but the user wants it in the background.  This
123203945Sweongyo             implies -n.  The recommended way to start X11 programs at a
124203945Sweongyo             remote site is with something like ssh -f host xterm.
125203945Sweongyo
126203945Sweongyo             If the ExitOnForwardFailure configuration option is set to
127203945Sweongyo             ``yes'', then a client started with -f will wait for all remote
128203945Sweongyo             port forwards to be successfully established before placing
129203945Sweongyo             itself in the background.
130203945Sweongyo
131203945Sweongyo     -g      Allows remote hosts to connect to local forwarded ports.
132203945Sweongyo
133203945Sweongyo     -I pkcs11
134203945Sweongyo             Specify the PKCS#11 shared library ssh should use to communicate
135203945Sweongyo             with a PKCS#11 token providing the user's private RSA key.
136203945Sweongyo
137203945Sweongyo     -i identity_file
138204922Sweongyo             Selects a file from which the identity (private key) for public
139203945Sweongyo             key authentication is read.  The default is ~/.ssh/identity for
140203945Sweongyo             protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and
141203945Sweongyo             ~/.ssh/id_rsa for protocol version 2.  Identity files may also be
142203945Sweongyo             specified on a per-host basis in the configuration file.  It is
143203945Sweongyo             possible to have multiple -i options (and multiple identities
144203945Sweongyo             specified in configuration files).  ssh will also try to load
145203945Sweongyo             certificate information from the filename obtained by appending
146203945Sweongyo             -cert.pub to identity filenames.
147203945Sweongyo
148203945Sweongyo     -K      Enables GSSAPI-based authentication and forwarding (delegation)
149203945Sweongyo             of GSSAPI credentials to the server.
150203945Sweongyo
151203945Sweongyo     -k      Disables forwarding (delegation) of GSSAPI credentials to the
152203945Sweongyo             server.
153203945Sweongyo
154203945Sweongyo     -L [bind_address:]port:host:hostport
155203945Sweongyo             Specifies that the given port on the local (client) host is to be
156203945Sweongyo             forwarded to the given host and port on the remote side.  This
157203945Sweongyo             works by allocating a socket to listen to port on the local side,
158203945Sweongyo             optionally bound to the specified bind_address.  Whenever a
159203945Sweongyo             connection is made to this port, the connection is forwarded over
160203945Sweongyo             the secure channel, and a connection is made to host port
161203945Sweongyo             hostport from the remote machine.  Port forwardings can also be
162203945Sweongyo             specified in the configuration file.  IPv6 addresses can be
163203945Sweongyo             specified by enclosing the address in square brackets.  Only the
164203945Sweongyo             superuser can forward privileged ports.  By default, the local
165203945Sweongyo             port is bound in accordance with the GatewayPorts setting.
166203945Sweongyo             However, an explicit bind_address may be used to bind the
167203945Sweongyo             connection to a specific address.  The bind_address of
168203945Sweongyo             ``localhost'' indicates that the listening port be bound for
169203945Sweongyo             local use only, while an empty address or `*' indicates that the
170203945Sweongyo             port should be available from all interfaces.
171203945Sweongyo
172203945Sweongyo     -l login_name
173203945Sweongyo             Specifies the user to log in as on the remote machine.  This also
174203945Sweongyo             may be specified on a per-host basis in the configuration file.
175203945Sweongyo
176203945Sweongyo     -M      Places the ssh client into ``master'' mode for connection
177203945Sweongyo             sharing.  Multiple -M options places ssh into ``master'' mode
178203945Sweongyo             with confirmation required before slave connections are accepted.
179203945Sweongyo             Refer to the description of ControlMaster in ssh_config(5) for
180203945Sweongyo             details.
181203945Sweongyo
182203945Sweongyo     -m mac_spec
183203945Sweongyo             Additionally, for protocol version 2 a comma-separated list of
184203945Sweongyo             MAC (message authentication code) algorithms can be specified in
185203945Sweongyo             order of preference.  See the MACs keyword for more information.
186203945Sweongyo
187203945Sweongyo     -N      Do not execute a remote command.  This is useful for just
188203945Sweongyo             forwarding ports (protocol version 2 only).
189203945Sweongyo
190203945Sweongyo     -n      Redirects stdin from /dev/null (actually, prevents reading from
191203945Sweongyo             stdin).  This must be used when ssh is run in the background.  A
192203945Sweongyo             common trick is to use this to run X11 programs on a remote
193203945Sweongyo             machine.  For example, ssh -n shadows.cs.hut.fi emacs & will
194203945Sweongyo             start an emacs on shadows.cs.hut.fi, and the X11 connection will
195203945Sweongyo             be automatically forwarded over an encrypted channel.  The ssh
196228621Sbschmidt             program will be put in the background.  (This does not work if
197228621Sbschmidt             ssh needs to ask for a password or passphrase; see also the -f
198203945Sweongyo             option.)
199203945Sweongyo
200203945Sweongyo     -O ctl_cmd
201203945Sweongyo             Control an active connection multiplexing master process.  When
202203945Sweongyo             the -O option is specified, the ctl_cmd argument is interpreted
203203945Sweongyo             and passed to the master process.  Valid commands are: ``check''
204203945Sweongyo             (check that the master process is running), ``forward'' (request
205203945Sweongyo             forwardings without command execution) and ``exit'' (request the
206203945Sweongyo             master to exit).
207203945Sweongyo
208203945Sweongyo     -o option
209203945Sweongyo             Can be used to give options in the format used in the
210203945Sweongyo             configuration file.  This is useful for specifying options for
211203945Sweongyo             which there is no separate command-line flag.  For full details
212203945Sweongyo             of the options listed below, and their possible values, see
213203945Sweongyo             ssh_config(5).
214203945Sweongyo
215203945Sweongyo                   AddressFamily
216203945Sweongyo                   BatchMode
217203945Sweongyo                   BindAddress
218203945Sweongyo                   ChallengeResponseAuthentication
219203945Sweongyo                   CheckHostIP
220203945Sweongyo                   Cipher
221203945Sweongyo                   Ciphers
222203945Sweongyo                   ClearAllForwardings
223203945Sweongyo                   Compression
224203945Sweongyo                   CompressionLevel
225203945Sweongyo                   ConnectionAttempts
226203945Sweongyo                   ConnectTimeout
227203945Sweongyo                   ControlMaster
228203945Sweongyo                   ControlPath
229203945Sweongyo                   DynamicForward
230203945Sweongyo                   EscapeChar
231203945Sweongyo                   ExitOnForwardFailure
232203945Sweongyo                   ForwardAgent
233203945Sweongyo                   ForwardX11
234203945Sweongyo                   ForwardX11Trusted
235203945Sweongyo                   GatewayPorts
236203945Sweongyo                   GlobalKnownHostsFile
237203945Sweongyo                   GSSAPIAuthentication
238203945Sweongyo                   GSSAPIDelegateCredentials
239203945Sweongyo                   HashKnownHosts
240203945Sweongyo                   Host
241203945Sweongyo                   HostbasedAuthentication
242203945Sweongyo                   HostKeyAlgorithms
243203945Sweongyo                   HostKeyAlias
244203945Sweongyo                   HostName
245203945Sweongyo                   IdentityFile
246203945Sweongyo                   IdentitiesOnly
247203945Sweongyo                   IPQoS
248203945Sweongyo                   KbdInteractiveDevices
249203945Sweongyo                   KexAlgorithms
250203945Sweongyo                   LocalCommand
251203945Sweongyo                   LocalForward
252203945Sweongyo                   LogLevel
253203945Sweongyo                   MACs
254203945Sweongyo                   NoHostAuthenticationForLocalhost
255203945Sweongyo                   NumberOfPasswordPrompts
256203945Sweongyo                   PasswordAuthentication
257203945Sweongyo                   PermitLocalCommand
258203945Sweongyo                   PKCS11Provider
259203945Sweongyo                   Port
260203945Sweongyo                   PreferredAuthentications
261203945Sweongyo                   Protocol
262203945Sweongyo                   ProxyCommand
263203945Sweongyo                   PubkeyAuthentication
264203945Sweongyo                   RekeyLimit
265203945Sweongyo                   RemoteForward
266203945Sweongyo                   RhostsRSAAuthentication
267203945Sweongyo                   RSAAuthentication
268203945Sweongyo                   SendEnv
269203945Sweongyo                   ServerAliveInterval
270203945Sweongyo                   ServerAliveCountMax
271203945Sweongyo                   StrictHostKeyChecking
272203945Sweongyo                   TCPKeepAlive
273203945Sweongyo                   Tunnel
274203945Sweongyo                   TunnelDevice
275203945Sweongyo                   UsePrivilegedPort
276203945Sweongyo                   User
277203945Sweongyo                   UserKnownHostsFile
278203945Sweongyo                   VerifyHostKeyDNS
279203945Sweongyo                   VisualHostKey
280203945Sweongyo                   XAuthLocation
281203945Sweongyo
282203945Sweongyo     -p port
283203945Sweongyo             Port to connect to on the remote host.  This can be specified on
284203945Sweongyo             a per-host basis in the configuration file.
285203945Sweongyo
286203945Sweongyo     -q      Quiet mode.  Causes most warning and diagnostic messages to be
287203945Sweongyo             suppressed.
288203945Sweongyo
289203945Sweongyo     -R [bind_address:]port:host:hostport
290203945Sweongyo             Specifies that the given port on the remote (server) host is to
291203945Sweongyo             be forwarded to the given host and port on the local side.  This
292203945Sweongyo             works by allocating a socket to listen to port on the remote
293203945Sweongyo             side, and whenever a connection is made to this port, the
294203945Sweongyo             connection is forwarded over the secure channel, and a connection
295203945Sweongyo             is made to host port hostport from the local machine.
296203945Sweongyo
297203945Sweongyo             Port forwardings can also be specified in the configuration file.
298203945Sweongyo             Privileged ports can be forwarded only when logging in as root on
299203945Sweongyo             the remote machine.  IPv6 addresses can be specified by enclosing
300203945Sweongyo             the address in square braces.
301203945Sweongyo
302203945Sweongyo             By default, the listening socket on the server will be bound to
303203945Sweongyo             the loopback interface only.  This may be overridden by
304203945Sweongyo             specifying a bind_address.  An empty bind_address, or the address
305203945Sweongyo             `*', indicates that the remote socket should listen on all
306203945Sweongyo             interfaces.  Specifying a remote bind_address will only succeed
307203945Sweongyo             if the server's GatewayPorts option is enabled (see
308203945Sweongyo             sshd_config(5)).
309203945Sweongyo
310203945Sweongyo             If the port argument is `0', the listen port will be dynamically
311203945Sweongyo             allocated on the server and reported to the client at run time.
312203945Sweongyo             When used together with -O forward the allocated port will be
313203945Sweongyo             printed to the standard output.
314203945Sweongyo
315203945Sweongyo     -S ctl_path
316203945Sweongyo             Specifies the location of a control socket for connection
317203945Sweongyo             sharing, or the string ``none'' to disable connection sharing.
318203945Sweongyo             Refer to the description of ControlPath and ControlMaster in
319203945Sweongyo             ssh_config(5) for details.
320203945Sweongyo
321203945Sweongyo     -s      May be used to request invocation of a subsystem on the remote
322203945Sweongyo             system.  Subsystems are a feature of the SSH2 protocol which
323203945Sweongyo             facilitate the use of SSH as a secure transport for other
324203945Sweongyo             applications (eg. sftp(1)).  The subsystem is specified as the
325203945Sweongyo             remote command.
326203945Sweongyo
327203945Sweongyo     -T      Disable pseudo-tty allocation.
328203945Sweongyo
329203945Sweongyo     -t      Force pseudo-tty allocation.  This can be used to execute
330203945Sweongyo             arbitrary screen-based programs on a remote machine, which can be
331203945Sweongyo             very useful, e.g. when implementing menu services.  Multiple -t
332203945Sweongyo             options force tty allocation, even if ssh has no local tty.
333203945Sweongyo
334203945Sweongyo     -V      Display the version number and exit.
335203945Sweongyo
336203945Sweongyo     -v      Verbose mode.  Causes ssh to print debugging messages about its
337203945Sweongyo             progress.  This is helpful in debugging connection,
338203945Sweongyo             authentication, and configuration problems.  Multiple -v options
339203945Sweongyo             increase the verbosity.  The maximum is 3.
340203945Sweongyo
341203945Sweongyo     -W host:port
342203945Sweongyo             Requests that standard input and output on the client be
343203945Sweongyo             forwarded to host on port over the secure channel.  Implies -N,
344203945Sweongyo             -T, ExitOnForwardFailure and ClearAllForwardings and works with
345203945Sweongyo             Protocol version 2 only.
346203945Sweongyo
347203945Sweongyo     -w local_tun[:remote_tun]
348203945Sweongyo             Requests tunnel device forwarding with the specified tun(4)
349203945Sweongyo             devices between the client (local_tun) and the server
350203945Sweongyo             (remote_tun).
351203945Sweongyo
352203945Sweongyo             The devices may be specified by numerical ID or the keyword
353203945Sweongyo             ``any'', which uses the next available tunnel device.  If
354203945Sweongyo             remote_tun is not specified, it defaults to ``any''.  See also
355203945Sweongyo             the Tunnel and TunnelDevice directives in ssh_config(5).  If the
356203945Sweongyo             Tunnel directive is unset, it is set to the default tunnel mode,
357203945Sweongyo             which is ``point-to-point''.
358203945Sweongyo
359203945Sweongyo     -X      Enables X11 forwarding.  This can also be specified on a per-host
360203945Sweongyo             basis in a configuration file.
361203945Sweongyo
362203945Sweongyo             X11 forwarding should be enabled with caution.  Users with the
363203945Sweongyo             ability to bypass file permissions on the remote host (for the
364203945Sweongyo             user's X authorization database) can access the local X11 display
365203945Sweongyo             through the forwarded connection.  An attacker may then be able
366203945Sweongyo             to perform activities such as keystroke monitoring.
367203945Sweongyo
368203945Sweongyo             For this reason, X11 forwarding is subjected to X11 SECURITY
369203945Sweongyo             extension restrictions by default.  Please refer to the ssh -Y
370203945Sweongyo             option and the ForwardX11Trusted directive in ssh_config(5) for
371203945Sweongyo             more information.
372203945Sweongyo
373203945Sweongyo     -x      Disables X11 forwarding.
374203945Sweongyo
375203945Sweongyo     -Y      Enables trusted X11 forwarding.  Trusted X11 forwardings are not
376203945Sweongyo             subjected to the X11 SECURITY extension controls.
377203945Sweongyo
378203945Sweongyo     -y      Send log information using the syslog(3) system module.  By
379203945Sweongyo             default this information is sent to stderr.
380203945Sweongyo
381203945Sweongyo     ssh may additionally obtain configuration data from a per-user
382203945Sweongyo     configuration file and a system-wide configuration file.  The file format
383203945Sweongyo     and configuration options are described in ssh_config(5).
384203945Sweongyo
385203945SweongyoAUTHENTICATION
386203945Sweongyo     The OpenSSH SSH client supports SSH protocols 1 and 2.  The default is to
387203945Sweongyo     use protocol 2 only, though this can be changed via the Protocol option
388203945Sweongyo     in ssh_config(5) or the -1 and -2 options (see above).  Both protocols
389203945Sweongyo     support similar authentication methods, but protocol 2 is the default
390203945Sweongyo     since it provides additional mechanisms for confidentiality (the traffic
391203945Sweongyo     is encrypted using AES, 3DES, Blowfish, CAST128, or Arcfour) and
392203945Sweongyo     integrity (hmac-md5, hmac-sha1, umac-64, hmac-ripemd160).  Protocol 1
393203945Sweongyo     lacks a strong mechanism for ensuring the integrity of the connection.
394203945Sweongyo
395203945Sweongyo     The methods available for authentication are: GSSAPI-based
396203945Sweongyo     authentication, host-based authentication, public key authentication,
397203945Sweongyo     challenge-response authentication, and password authentication.
398203945Sweongyo     Authentication methods are tried in the order specified above, though
399203945Sweongyo     protocol 2 has a configuration option to change the default order:
400203945Sweongyo     PreferredAuthentications.
401203945Sweongyo
402203945Sweongyo     Host-based authentication works as follows: If the machine the user logs
403203945Sweongyo     in from is listed in /etc/hosts.equiv or /etc/shosts.equiv on the remote
404203945Sweongyo     machine, and the user names are the same on both sides, or if the files
405203945Sweongyo     ~/.rhosts or ~/.shosts exist in the user's home directory on the remote
406203945Sweongyo     machine and contain a line containing the name of the client machine and
407203945Sweongyo     the name of the user on that machine, the user is considered for login.
408203945Sweongyo     Additionally, the server must be able to verify the client's host key
409203945Sweongyo     (see the description of /etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts,
410203945Sweongyo     below) for login to be permitted.  This authentication method closes
411203945Sweongyo     security holes due to IP spoofing, DNS spoofing, and routing spoofing.
412203945Sweongyo     [Note to the administrator: /etc/hosts.equiv, ~/.rhosts, and the
413203945Sweongyo     rlogin/rsh protocol in general, are inherently insecure and should be
414203945Sweongyo     disabled if security is desired.]
415203945Sweongyo
416203945Sweongyo     Public key authentication works as follows: The scheme is based on
417203945Sweongyo     public-key cryptography, using cryptosystems where encryption and
418203945Sweongyo     decryption are done using separate keys, and it is unfeasible to derive
419203945Sweongyo     the decryption key from the encryption key.  The idea is that each user
420203945Sweongyo     creates a public/private key pair for authentication purposes.  The
421203945Sweongyo     server knows the public key, and only the user knows the private key.
422203945Sweongyo     ssh implements public key authentication protocol automatically, using
423203945Sweongyo     one of the DSA, ECDSA or RSA algorithms.  Protocol 1 is restricted to
424203945Sweongyo     using only RSA keys, but protocol 2 may use any.  The HISTORY section of
425203945Sweongyo     ssl(8) contains a brief discussion of the DSA and RSA algorithms.
426203945Sweongyo
427203945Sweongyo     The file ~/.ssh/authorized_keys lists the public keys that are permitted
428203945Sweongyo     for logging in.  When the user logs in, the ssh program tells the server
429203945Sweongyo     which key pair it would like to use for authentication.  The client
430203945Sweongyo     proves that it has access to the private key and the server checks that
431203945Sweongyo     the corresponding public key is authorized to accept the account.
432203945Sweongyo
433203945Sweongyo     The user creates his/her key pair by running ssh-keygen(1).  This stores
434203945Sweongyo     the private key in ~/.ssh/identity (protocol 1), ~/.ssh/id_dsa (protocol
435203945Sweongyo     2 DSA), ~/.ssh/id_ecdsa (protocol 2 ECDSA), or ~/.ssh/id_rsa (protocol 2
436203945Sweongyo     RSA) and stores the public key in ~/.ssh/identity.pub (protocol 1),
437203945Sweongyo     ~/.ssh/id_dsa.pub (protocol 2 DSA), ~/.ssh/id_ecdsa.pub (protocol 2
438203945Sweongyo     ECDSA), or ~/.ssh/id_rsa.pub (protocol 2 RSA) in the user's home
439203945Sweongyo     directory.  The user should then copy the public key to
440203945Sweongyo     ~/.ssh/authorized_keys in his/her home directory on the remote machine.
441203945Sweongyo     The authorized_keys file corresponds to the conventional ~/.rhosts file,
442203945Sweongyo     and has one key per line, though the lines can be very long.  After this,
443203945Sweongyo     the user can log in without giving the password.
444203945Sweongyo
445203945Sweongyo     A variation on public key authentication is available in the form of
446203945Sweongyo     certificate authentication: instead of a set of public/private keys,
447203945Sweongyo     signed certificates are used.  This has the advantage that a single
448203945Sweongyo     trusted certification authority can be used in place of many
449203945Sweongyo     public/private keys.  See the CERTIFICATES section of ssh-keygen(1) for
450203945Sweongyo     more information.
451203945Sweongyo
452203945Sweongyo     The most convenient way to use public key or certificate authentication
453203945Sweongyo     may be with an authentication agent.  See ssh-agent(1) for more
454203945Sweongyo     information.
455203945Sweongyo
456203945Sweongyo     Challenge-response authentication works as follows: The server sends an
457203945Sweongyo     arbitrary "challenge" text, and prompts for a response.  Protocol 2
458203945Sweongyo     allows multiple challenges and responses; protocol 1 is restricted to
459203945Sweongyo     just one challenge/response.  Examples of challenge-response
460203945Sweongyo     authentication include BSD Authentication (see login.conf(5)) and PAM
461203945Sweongyo     (some non-OpenBSD systems).
462203945Sweongyo
463203945Sweongyo     Finally, if other authentication methods fail, ssh prompts the user for a
464203945Sweongyo     password.  The password is sent to the remote host for checking; however,
465203945Sweongyo     since all communications are encrypted, the password cannot be seen by
466203945Sweongyo     someone listening on the network.
467203945Sweongyo
468203945Sweongyo     ssh automatically maintains and checks a database containing
469203945Sweongyo     identification for all hosts it has ever been used with.  Host keys are
470203945Sweongyo     stored in ~/.ssh/known_hosts in the user's home directory.  Additionally,
471203945Sweongyo     the file /etc/ssh/ssh_known_hosts is automatically checked for known
472203945Sweongyo     hosts.  Any new hosts are automatically added to the user's file.  If a
473203945Sweongyo     host's identification ever changes, ssh warns about this and disables
474203945Sweongyo     password authentication to prevent server spoofing or man-in-the-middle
475203945Sweongyo     attacks, which could otherwise be used to circumvent the encryption.  The
476203945Sweongyo     StrictHostKeyChecking option can be used to control logins to machines
477203945Sweongyo     whose host key is not known or has changed.
478203945Sweongyo
479203945Sweongyo     When the user's identity has been accepted by the server, the server
480203945Sweongyo     either executes the given command, or logs into the machine and gives the
481203945Sweongyo     user a normal shell on the remote machine.  All communication with the
482203945Sweongyo     remote command or shell will be automatically encrypted.
483203945Sweongyo
484203945Sweongyo     If a pseudo-terminal has been allocated (normal login session), the user
485203945Sweongyo     may use the escape characters noted below.
486203945Sweongyo
487203945Sweongyo     If no pseudo-tty has been allocated, the session is transparent and can
488203945Sweongyo     be used to reliably transfer binary data.  On most systems, setting the
489203945Sweongyo     escape character to ``none'' will also make the session transparent even
490203945Sweongyo     if a tty is used.
491203945Sweongyo
492203945Sweongyo     The session terminates when the command or shell on the remote machine
493203945Sweongyo     exits and all X11 and TCP connections have been closed.
494203945Sweongyo
495203945SweongyoESCAPE CHARACTERS
496203945Sweongyo     When a pseudo-terminal has been requested, ssh supports a number of
497203945Sweongyo     functions through the use of an escape character.
498203945Sweongyo
499203945Sweongyo     A single tilde character can be sent as ~~ or by following the tilde by a
500203945Sweongyo     character other than those described below.  The escape character must
501203945Sweongyo     always follow a newline to be interpreted as special.  The escape
502203945Sweongyo     character can be changed in configuration files using the EscapeChar
503203945Sweongyo     configuration directive or on the command line by the -e option.
504203945Sweongyo
505203945Sweongyo     The supported escapes (assuming the default `~') are:
506203945Sweongyo
507203945Sweongyo     ~.      Disconnect.
508203945Sweongyo
509203945Sweongyo     ~^Z     Background ssh.
510203945Sweongyo
511203945Sweongyo     ~#      List forwarded connections.
512203945Sweongyo
513203945Sweongyo     ~&      Background ssh at logout when waiting for forwarded connection /
514203945Sweongyo             X11 sessions to terminate.
515203945Sweongyo
516203945Sweongyo     ~?      Display a list of escape characters.
517203945Sweongyo
518203945Sweongyo     ~B      Send a BREAK to the remote system (only useful for SSH protocol
519203945Sweongyo             version 2 and if the peer supports it).
520203945Sweongyo
521203945Sweongyo     ~C      Open command line.  Currently this allows the addition of port
522203945Sweongyo             forwardings using the -L, -R and -D options (see above).  It also
523203945Sweongyo             allows the cancellation of existing remote port-forwardings using
524203945Sweongyo             -KR[bind_address:]port.  !command allows the user to execute a
525203945Sweongyo             local command if the PermitLocalCommand option is enabled in
526203945Sweongyo             ssh_config(5).  Basic help is available, using the -h option.
527203945Sweongyo
528203945Sweongyo     ~R      Request rekeying of the connection (only useful for SSH protocol
529203945Sweongyo             version 2 and if the peer supports it).
530203945Sweongyo
531203945SweongyoTCP FORWARDING
532203945Sweongyo     Forwarding of arbitrary TCP connections over the secure channel can be
533203945Sweongyo     specified either on the command line or in a configuration file.  One
534204257Sweongyo     possible application of TCP forwarding is a secure connection to a mail
535203945Sweongyo     server; another is going through firewalls.
536203945Sweongyo
537203945Sweongyo     In the example below, we look at encrypting communication between an IRC
538203945Sweongyo     client and server, even though the IRC server does not directly support
539203945Sweongyo     encrypted communications.  This works as follows: the user connects to
540203945Sweongyo     the remote host using ssh, specifying a port to be used to forward
541203945Sweongyo     connections to the remote server.  After that it is possible to start the
542203945Sweongyo     service which is to be encrypted on the client machine, connecting to the
543203945Sweongyo     same local port, and ssh will encrypt and forward the connection.
544203945Sweongyo
545203945Sweongyo     The following example tunnels an IRC session from client machine
546203945Sweongyo     ``127.0.0.1'' (localhost) to remote server ``server.example.com'':
547203945Sweongyo
548203945Sweongyo         $ ssh -f -L 1234:localhost:6667 server.example.com sleep 10
549203945Sweongyo         $ irc -c '#users' -p 1234 pinky 127.0.0.1
550203945Sweongyo
551203945Sweongyo     This tunnels a connection to IRC server ``server.example.com'', joining
552203945Sweongyo     channel ``#users'', nickname ``pinky'', using port 1234.  It doesn't
553203945Sweongyo     matter which port is used, as long as it's greater than 1023 (remember,
554203945Sweongyo     only root can open sockets on privileged ports) and doesn't conflict with
555203945Sweongyo     any ports already in use.  The connection is forwarded to port 6667 on
556203945Sweongyo     the remote server, since that's the standard port for IRC services.
557203945Sweongyo
558203945Sweongyo     The -f option backgrounds ssh and the remote command ``sleep 10'' is
559203945Sweongyo     specified to allow an amount of time (10 seconds, in the example) to
560203945Sweongyo     start the service which is to be tunnelled.  If no connections are made
561203945Sweongyo     within the time specified, ssh will exit.
562203945Sweongyo
563203945SweongyoX11 FORWARDING
564203945Sweongyo     If the ForwardX11 variable is set to ``yes'' (or see the description of
565203945Sweongyo     the -X, -x, and -Y options above) and the user is using X11 (the DISPLAY
566203945Sweongyo     environment variable is set), the connection to the X11 display is
567203945Sweongyo     automatically forwarded to the remote side in such a way that any X11
568203945Sweongyo     programs started from the shell (or command) will go through the
569203945Sweongyo     encrypted channel, and the connection to the real X server will be made
570203945Sweongyo     from the local machine.  The user should not manually set DISPLAY.
571203945Sweongyo     Forwarding of X11 connections can be configured on the command line or in
572203945Sweongyo     configuration files.
573203945Sweongyo
574203945Sweongyo     The DISPLAY value set by ssh will point to the server machine, but with a
575203945Sweongyo     display number greater than zero.  This is normal, and happens because
576203945Sweongyo     ssh creates a ``proxy'' X server on the server machine for forwarding the
577203945Sweongyo     connections over the encrypted channel.
578203945Sweongyo
579203945Sweongyo     ssh will also automatically set up Xauthority data on the server machine.
580203945Sweongyo     For this purpose, it will generate a random authorization cookie, store
581203945Sweongyo     it in Xauthority on the server, and verify that any forwarded connections
582203945Sweongyo     carry this cookie and replace it by the real cookie when the connection
583203945Sweongyo     is opened.  The real authentication cookie is never sent to the server
584203945Sweongyo     machine (and no cookies are sent in the plain).
585203945Sweongyo
586203945Sweongyo     If the ForwardAgent variable is set to ``yes'' (or see the description of
587203945Sweongyo     the -A and -a options above) and the user is using an authentication
588203945Sweongyo     agent, the connection to the agent is automatically forwarded to the
589203945Sweongyo     remote side.
590203945Sweongyo
591203945SweongyoVERIFYING HOST KEYS
592203945Sweongyo     When connecting to a server for the first time, a fingerprint of the
593203945Sweongyo     server's public key is presented to the user (unless the option
594203945Sweongyo     StrictHostKeyChecking has been disabled).  Fingerprints can be determined
595203945Sweongyo     using ssh-keygen(1):
596203945Sweongyo
597203945Sweongyo           $ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key
598203945Sweongyo
599203945Sweongyo     If the fingerprint is already known, it can be matched and the key can be
600203945Sweongyo     accepted or rejected.  Because of the difficulty of comparing host keys
601203945Sweongyo     just by looking at hex strings, there is also support to compare host
602203945Sweongyo     keys visually, using random art.  By setting the VisualHostKey option to
603203945Sweongyo     ``yes'', a small ASCII graphic gets displayed on every login to a server,
604203945Sweongyo     no matter if the session itself is interactive or not.  By learning the
605203945Sweongyo     pattern a known server produces, a user can easily find out that the host
606203945Sweongyo     key has changed when a completely different pattern is displayed.
607203945Sweongyo     Because these patterns are not unambiguous however, a pattern that looks
608203945Sweongyo     similar to the pattern remembered only gives a good probability that the
609203945Sweongyo     host key is the same, not guaranteed proof.
610203945Sweongyo
611203945Sweongyo     To get a listing of the fingerprints along with their random art for all
612203945Sweongyo     known hosts, the following command line can be used:
613203945Sweongyo
614203945Sweongyo           $ ssh-keygen -lv -f ~/.ssh/known_hosts
615203945Sweongyo
616203945Sweongyo     If the fingerprint is unknown, an alternative method of verification is
617203945Sweongyo     available: SSH fingerprints verified by DNS.  An additional resource
618203945Sweongyo     record (RR), SSHFP, is added to a zonefile and the connecting client is
619203945Sweongyo     able to match the fingerprint with that of the key presented.
620203945Sweongyo
621203945Sweongyo     In this example, we are connecting a client to a server,
622203945Sweongyo     ``host.example.com''.  The SSHFP resource records should first be added
623203945Sweongyo     to the zonefile for host.example.com:
624203945Sweongyo
625203945Sweongyo           $ ssh-keygen -r host.example.com.
626203945Sweongyo
627203945Sweongyo     The output lines will have to be added to the zonefile.  To check that
628203945Sweongyo     the zone is answering fingerprint queries:
629203945Sweongyo
630203945Sweongyo           $ dig -t SSHFP host.example.com
631203945Sweongyo
632203945Sweongyo     Finally the client connects:
633203945Sweongyo
634203945Sweongyo           $ ssh -o "VerifyHostKeyDNS ask" host.example.com
635203945Sweongyo           [...]
636203945Sweongyo           Matching host key fingerprint found in DNS.
637203945Sweongyo           Are you sure you want to continue connecting (yes/no)?
638203945Sweongyo
639203945Sweongyo     See the VerifyHostKeyDNS option in ssh_config(5) for more information.
640203945Sweongyo
641203945SweongyoSSH-BASED VIRTUAL PRIVATE NETWORKS
642203945Sweongyo     ssh contains support for Virtual Private Network (VPN) tunnelling using
643203945Sweongyo     the tun(4) network pseudo-device, allowing two networks to be joined
644203945Sweongyo     securely.  The sshd_config(5) configuration option PermitTunnel controls
645203945Sweongyo     whether the server supports this, and at what level (layer 2 or 3
646203945Sweongyo     traffic).
647203945Sweongyo
648203945Sweongyo     The following example would connect client network 10.0.50.0/24 with
649203945Sweongyo     remote network 10.0.99.0/24 using a point-to-point connection from
650203945Sweongyo     10.1.1.1 to 10.1.1.2, provided that the SSH server running on the gateway
651203945Sweongyo     to the remote network, at 192.168.1.15, allows it.
652203945Sweongyo
653203945Sweongyo     On the client:
654203945Sweongyo
655203945Sweongyo           # ssh -f -w 0:1 192.168.1.15 true
656203945Sweongyo           # ifconfig tun0 10.1.1.1 10.1.1.2 netmask 255.255.255.252
657203945Sweongyo           # route add 10.0.99.0/24 10.1.1.2
658203945Sweongyo
659203945Sweongyo     On the server:
660203945Sweongyo
661203945Sweongyo           # ifconfig tun1 10.1.1.2 10.1.1.1 netmask 255.255.255.252
662203945Sweongyo           # route add 10.0.50.0/24 10.1.1.1
663203945Sweongyo
664203945Sweongyo     Client access may be more finely tuned via the /root/.ssh/authorized_keys
665203945Sweongyo     file (see below) and the PermitRootLogin server option.  The following
666203945Sweongyo     entry would permit connections on tun(4) device 1 from user ``jane'' and
667203945Sweongyo     on tun device 2 from user ``john'', if PermitRootLogin is set to
668203945Sweongyo     ``forced-commands-only'':
669203945Sweongyo
670203945Sweongyo       tunnel="1",command="sh /etc/netstart tun1" ssh-rsa ... jane
671203945Sweongyo       tunnel="2",command="sh /etc/netstart tun2" ssh-rsa ... john
672203945Sweongyo
673203945Sweongyo     Since an SSH-based setup entails a fair amount of overhead, it may be
674203945Sweongyo     more suited to temporary setups, such as for wireless VPNs.  More
675203945Sweongyo     permanent VPNs are better provided by tools such as ipsecctl(8) and
676203945Sweongyo     isakmpd(8).
677203945Sweongyo
678203945SweongyoENVIRONMENT
679203945Sweongyo     ssh will normally set the following environment variables:
680203945Sweongyo
681203945Sweongyo     DISPLAY               The DISPLAY variable indicates the location of the
682203945Sweongyo                           X11 server.  It is automatically set by ssh to
683203945Sweongyo                           point to a value of the form ``hostname:n'', where
684203945Sweongyo                           ``hostname'' indicates the host where the shell
685203945Sweongyo                           runs, and `n' is an integer >= 1.  ssh uses this
686203945Sweongyo                           special value to forward X11 connections over the
687203945Sweongyo                           secure channel.  The user should normally not set
688203945Sweongyo                           DISPLAY explicitly, as that will render the X11
689203945Sweongyo                           connection insecure (and will require the user to
690203945Sweongyo                           manually copy any required authorization cookies).
691203945Sweongyo
692203945Sweongyo     HOME                  Set to the path of the user's home directory.
693203945Sweongyo
694203945Sweongyo     LOGNAME               Synonym for USER; set for compatibility with
695203945Sweongyo                           systems that use this variable.
696203945Sweongyo
697203945Sweongyo     MAIL                  Set to the path of the user's mailbox.
698203945Sweongyo
699203945Sweongyo     PATH                  Set to the default PATH, as specified when
700203945Sweongyo                           compiling ssh.
701203945Sweongyo
702203945Sweongyo     SSH_ASKPASS           If ssh needs a passphrase, it will read the
703203945Sweongyo                           passphrase from the current terminal if it was run
704203945Sweongyo                           from a terminal.  If ssh does not have a terminal
705203945Sweongyo                           associated with it but DISPLAY and SSH_ASKPASS are
706203945Sweongyo                           set, it will execute the program specified by
707203945Sweongyo                           SSH_ASKPASS and open an X11 window to read the
708203945Sweongyo                           passphrase.  This is particularly useful when
709203945Sweongyo                           calling ssh from a .xsession or related script.
710203945Sweongyo                           (Note that on some machines it may be necessary to
711203945Sweongyo                           redirect the input from /dev/null to make this
712203945Sweongyo                           work.)
713203945Sweongyo
714203945Sweongyo     SSH_AUTH_SOCK         Identifies the path of a UNIX-domain socket used to
715203945Sweongyo                           communicate with the agent.
716203945Sweongyo
717203945Sweongyo     SSH_CONNECTION        Identifies the client and server ends of the
718203945Sweongyo                           connection.  The variable contains four space-
719203945Sweongyo                           separated values: client IP address, client port
720203945Sweongyo                           number, server IP address, and server port number.
721203945Sweongyo
722203945Sweongyo     SSH_ORIGINAL_COMMAND  This variable contains the original command line if
723203945Sweongyo                           a forced command is executed.  It can be used to
724203945Sweongyo                           extract the original arguments.
725203945Sweongyo
726203945Sweongyo     SSH_TTY               This is set to the name of the tty (path to the
727203945Sweongyo                           device) associated with the current shell or
728203945Sweongyo                           command.  If the current session has no tty, this
729203945Sweongyo                           variable is not set.
730203945Sweongyo
731203945Sweongyo     TZ                    This variable is set to indicate the present time
732203945Sweongyo                           zone if it was set when the daemon was started
733203945Sweongyo                           (i.e. the daemon passes the value on to new
734203945Sweongyo                           connections).
735203945Sweongyo
736203945Sweongyo     USER                  Set to the name of the user logging in.
737203945Sweongyo
738203945Sweongyo     Additionally, ssh reads ~/.ssh/environment, and adds lines of the format
739203945Sweongyo     ``VARNAME=value'' to the environment if the file exists and users are
740203945Sweongyo     allowed to change their environment.  For more information, see the
741203945Sweongyo     PermitUserEnvironment option in sshd_config(5).
742203945Sweongyo
743203945SweongyoFILES
744203945Sweongyo     ~/.rhosts
745203945Sweongyo             This file is used for host-based authentication (see above).  On
746203945Sweongyo             some machines this file may need to be world-readable if the
747203945Sweongyo             user's home directory is on an NFS partition, because sshd(8)
748203945Sweongyo             reads it as root.  Additionally, this file must be owned by the
749203945Sweongyo             user, and must not have write permissions for anyone else.  The
750203945Sweongyo             recommended permission for most machines is read/write for the
751203945Sweongyo             user, and not accessible by others.
752203945Sweongyo
753203945Sweongyo     ~/.shosts
754203945Sweongyo             This file is used in exactly the same way as .rhosts, but allows
755203945Sweongyo             host-based authentication without permitting login with
756203945Sweongyo             rlogin/rsh.
757203945Sweongyo
758203945Sweongyo     ~/.ssh/
759203945Sweongyo             This directory is the default location for all user-specific
760203945Sweongyo             configuration and authentication information.  There is no
761203945Sweongyo             general requirement to keep the entire contents of this directory
762203945Sweongyo             secret, but the recommended permissions are read/write/execute
763203945Sweongyo             for the user, and not accessible by others.
764203945Sweongyo
765203945Sweongyo     ~/.ssh/authorized_keys
766203945Sweongyo             Lists the public keys (DSA/ECDSA/RSA) that can be used for
767203945Sweongyo             logging in as this user.  The format of this file is described in
768203945Sweongyo             the sshd(8) manual page.  This file is not highly sensitive, but
769203945Sweongyo             the recommended permissions are read/write for the user, and not
770203945Sweongyo             accessible by others.
771203945Sweongyo
772203945Sweongyo     ~/.ssh/config
773203945Sweongyo             This is the per-user configuration file.  The file format and
774203945Sweongyo             configuration options are described in ssh_config(5).  Because of
775203945Sweongyo             the potential for abuse, this file must have strict permissions:
776203945Sweongyo             read/write for the user, and not accessible by others.
777203945Sweongyo
778203945Sweongyo     ~/.ssh/environment
779203945Sweongyo             Contains additional definitions for environment variables; see
780203945Sweongyo             ENVIRONMENT, above.
781203945Sweongyo
782203945Sweongyo     ~/.ssh/identity
783203945Sweongyo     ~/.ssh/id_dsa
784203945Sweongyo     ~/.ssh/id_ecdsa
785203945Sweongyo     ~/.ssh/id_rsa
786203945Sweongyo             Contains the private key for authentication.  These files contain
787203945Sweongyo             sensitive data and should be readable by the user but not
788203945Sweongyo             accessible by others (read/write/execute).  ssh will simply
789203945Sweongyo             ignore a private key file if it is accessible by others.  It is
790203945Sweongyo             possible to specify a passphrase when generating the key which
791203945Sweongyo             will be used to encrypt the sensitive part of this file using
792203945Sweongyo             3DES.
793203945Sweongyo
794203945Sweongyo     ~/.ssh/identity.pub
795203945Sweongyo     ~/.ssh/id_dsa.pub
796203945Sweongyo     ~/.ssh/id_ecdsa.pub
797203945Sweongyo     ~/.ssh/id_rsa.pub
798203945Sweongyo             Contains the public key for authentication.  These files are not
799203945Sweongyo             sensitive and can (but need not) be readable by anyone.
800203945Sweongyo
801203945Sweongyo     ~/.ssh/known_hosts
802203945Sweongyo             Contains a list of host keys for all hosts the user has logged
803203945Sweongyo             into that are not already in the systemwide list of known host
804203945Sweongyo             keys.  See sshd(8) for further details of the format of this
805203945Sweongyo             file.
806203945Sweongyo
807203945Sweongyo     ~/.ssh/rc
808203945Sweongyo             Commands in this file are executed by ssh when the user logs in,
809203945Sweongyo             just before the user's shell (or command) is started.  See the
810203945Sweongyo             sshd(8) manual page for more information.
811203945Sweongyo
812203945Sweongyo     /etc/hosts.equiv
813203945Sweongyo             This file is for host-based authentication (see above).  It
814203945Sweongyo             should only be writable by root.
815203945Sweongyo
816203945Sweongyo     /etc/shosts.equiv
817203945Sweongyo             This file is used in exactly the same way as hosts.equiv, but
818203945Sweongyo             allows host-based authentication without permitting login with
819203945Sweongyo             rlogin/rsh.
820203945Sweongyo
821203945Sweongyo     /etc/ssh/ssh_config
822203945Sweongyo             Systemwide configuration file.  The file format and configuration
823203945Sweongyo             options are described in ssh_config(5).
824203945Sweongyo
825203945Sweongyo     /etc/ssh/ssh_host_key
826203945Sweongyo     /etc/ssh/ssh_host_dsa_key
827203945Sweongyo     /etc/ssh/ssh_host_ecdsa_key
828203945Sweongyo     /etc/ssh/ssh_host_rsa_key
829203945Sweongyo             These three files contain the private parts of the host keys and
830203945Sweongyo             are used for host-based authentication.  If protocol version 1 is
831203945Sweongyo             used, ssh must be setuid root, since the host key is readable
832203945Sweongyo             only by root.  For protocol version 2, ssh uses ssh-keysign(8) to
833203945Sweongyo             access the host keys, eliminating the requirement that ssh be
834203945Sweongyo             setuid root when host-based authentication is used.  By default
835203945Sweongyo             ssh is not setuid root.
836203945Sweongyo
837203945Sweongyo     /etc/ssh/ssh_known_hosts
838203945Sweongyo             Systemwide list of known host keys.  This file should be prepared
839203945Sweongyo             by the system administrator to contain the public host keys of
840203945Sweongyo             all machines in the organization.  It should be world-readable.
841203945Sweongyo             See sshd(8) for further details of the format of this file.
842203945Sweongyo
843203945Sweongyo     /etc/ssh/sshrc
844203945Sweongyo             Commands in this file are executed by ssh when the user logs in,
845203945Sweongyo             just before the user's shell (or command) is started.  See the
846203945Sweongyo             sshd(8) manual page for more information.
847203945Sweongyo
848203945SweongyoEXIT STATUS
849203945Sweongyo     ssh exits with the exit status of the remote command or with 255 if an
850203945Sweongyo     error occurred.
851203945Sweongyo
852203945SweongyoSEE ALSO
853203945Sweongyo     scp(1), sftp(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh-keyscan(1),
854203945Sweongyo     tun(4), hosts.equiv(5), ssh_config(5), ssh-keysign(8), sshd(8)
855203945Sweongyo
856203945Sweongyo     The Secure Shell (SSH) Protocol Assigned Numbers, RFC 4250, 2006.
857203945Sweongyo
858203945Sweongyo     The Secure Shell (SSH) Protocol Architecture, RFC 4251, 2006.
859203945Sweongyo
860203945Sweongyo     The Secure Shell (SSH) Authentication Protocol, RFC 4252, 2006.
861203945Sweongyo
862203945Sweongyo     The Secure Shell (SSH) Transport Layer Protocol, RFC 4253, 2006.
863203945Sweongyo
864203945Sweongyo     The Secure Shell (SSH) Connection Protocol, RFC 4254, 2006.
865203945Sweongyo
866203945Sweongyo     Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints, RFC
867203945Sweongyo     4255, 2006.
868203945Sweongyo
869203945Sweongyo     Generic Message Exchange Authentication for the Secure Shell Protocol
870203945Sweongyo     (SSH), RFC 4256, 2006.
871203945Sweongyo
872203945Sweongyo     The Secure Shell (SSH) Session Channel Break Extension, RFC 4335, 2006.
873203945Sweongyo
874203945Sweongyo     The Secure Shell (SSH) Transport Layer Encryption Modes, RFC 4344, 2006.
875203945Sweongyo
876203945Sweongyo     Improved Arcfour Modes for the Secure Shell (SSH) Transport Layer
877203945Sweongyo     Protocol, RFC 4345, 2006.
878203945Sweongyo
879203945Sweongyo     Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer
880203945Sweongyo     Protocol, RFC 4419, 2006.
881203945Sweongyo
882203945Sweongyo     The Secure Shell (SSH) Public Key File Format, RFC 4716, 2006.
883203945Sweongyo
884203945Sweongyo     Elliptic Curve Algorithm Integration in the Secure Shell Transport Layer,
885203945Sweongyo     RFC 5656, 2009.
886203945Sweongyo
887203945Sweongyo     A. Perrig and D. Song, Hash Visualization: a New Technique to improve
888203945Sweongyo     Real-World Security, 1999, International Workshop on Cryptographic
889203945Sweongyo     Techniques and E-Commerce (CrypTEC '99).
890203945Sweongyo
891203945SweongyoAUTHORS
892203945Sweongyo     OpenSSH is a derivative of the original and free ssh 1.2.12 release by
893203945Sweongyo     Tatu Ylonen.  Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
894203945Sweongyo     de Raadt and Dug Song removed many bugs, re-added newer features and
895203945Sweongyo     created OpenSSH.  Markus Friedl contributed the support for SSH protocol
896203945Sweongyo     versions 1.5 and 2.0.
897203945Sweongyo
898203945SweongyoOpenBSD 4.9                    November 18, 2010                   OpenBSD 4.9
899203945Sweongyo