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