Merge branch 'vendor/TCSH'
[dragonfly.git] / crypto / openssh / ssh.1
1 .\"
2 .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3 .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 .\"                    All rights reserved
5 .\"
6 .\" As far as I am concerned, the code I have written for this software
7 .\" can be used freely for any purpose.  Any derived versions of this
8 .\" software must be clearly marked as such, and if the derived work is
9 .\" incompatible with the protocol description in the RFC file, it must be
10 .\" called by a name other than "ssh" or "Secure Shell".
11 .\"
12 .\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
13 .\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
14 .\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
15 .\"
16 .\" Redistribution and use in source and binary forms, with or without
17 .\" modification, are permitted provided that the following conditions
18 .\" are met:
19 .\" 1. Redistributions of source code must retain the above copyright
20 .\"    notice, this list of conditions and the following disclaimer.
21 .\" 2. Redistributions in binary form must reproduce the above copyright
22 .\"    notice, this list of conditions and the following disclaimer in the
23 .\"    documentation and/or other materials provided with the distribution.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 .\"
36 .\" $OpenBSD: ssh.1,v 1.384 2017/09/21 19:16:53 markus Exp $
37 .Dd $Mdocdate: September 21 2017 $
38 .Dt SSH 1
39 .Os
40 .Sh NAME
41 .Nm ssh
42 .Nd OpenSSH SSH client (remote login program)
43 .Sh SYNOPSIS
44 .Nm ssh
45 .Bk -words
46 .Op Fl 46AaCfGgKkMNnqsTtVvXxYy
47 .Op Fl b Ar bind_address
48 .Op Fl c Ar cipher_spec
49 .Op Fl D Oo Ar bind_address : Oc Ns Ar port
50 .Op Fl E Ar log_file
51 .Op Fl e Ar escape_char
52 .Op Fl F Ar configfile
53 .Op Fl I Ar pkcs11
54 .Op Fl i Ar identity_file
55 .Op Fl J Oo Ar user Ns @ Oc Ns Ar host Ns Op : Ns Ar port
56 .Op Fl L Ar address
57 .Op Fl l Ar login_name
58 .Op Fl m Ar mac_spec
59 .Op Fl O Ar ctl_cmd
60 .Op Fl o Ar option
61 .Op Fl p Ar port
62 .Op Fl Q Ar query_option
63 .Op Fl R Ar address
64 .Op Fl S Ar ctl_path
65 .Op Fl W Ar host : Ns Ar port
66 .Op Fl w Ar local_tun Ns Op : Ns Ar remote_tun
67 .Oo Ar user Ns @ Oc Ns Ar hostname
68 .Op Ar command
69 .Ek
70 .Sh DESCRIPTION
71 .Nm
72 (SSH client) is a program for logging into a remote machine and for
73 executing commands on a remote machine.
74 It is intended to provide secure encrypted communications between
75 two untrusted hosts over an insecure network.
76 X11 connections, arbitrary TCP ports and
77 .Ux Ns -domain
78 sockets can also be forwarded over the secure channel.
79 .Pp
80 .Nm
81 connects and logs into the specified
82 .Ar hostname
83 (with optional
84 .Ar user
85 name).
86 The user must prove
87 his/her identity to the remote machine using one of several methods
88 (see below).
89 .Pp
90 If
91 .Ar command
92 is specified,
93 it is executed on the remote host instead of a login shell.
94 .Pp
95 The options are as follows:
96 .Pp
97 .Bl -tag -width Ds -compact
98 .It Fl 4
99 Forces
100 .Nm
101 to use IPv4 addresses only.
102 .Pp
103 .It Fl 6
104 Forces
105 .Nm
106 to use IPv6 addresses only.
107 .Pp
108 .It Fl A
109 Enables forwarding of the authentication agent connection.
110 This can also be specified on a per-host basis in a configuration file.
111 .Pp
112 Agent forwarding should be enabled with caution.
113 Users with the ability to bypass file permissions on the remote host
114 (for the agent's
115 .Ux Ns -domain
116 socket) can access the local agent through the forwarded connection.
117 An attacker cannot obtain key material from the agent,
118 however they can perform operations on the keys that enable them to
119 authenticate using the identities loaded into the agent.
120 .Pp
121 .It Fl a
122 Disables forwarding of the authentication agent connection.
123 .Pp
124 .It Fl b Ar bind_address
125 Use
126 .Ar bind_address
127 on the local machine as the source address
128 of the connection.
129 Only useful on systems with more than one address.
130 .Pp
131 .It Fl C
132 Requests compression of all data (including stdin, stdout, stderr, and
133 data for forwarded X11, TCP and
134 .Ux Ns -domain
135 connections).
136 The compression algorithm is the same used by
137 .Xr gzip 1 .
138 Compression is desirable on modem lines and other
139 slow connections, but will only slow down things on fast networks.
140 The default value can be set on a host-by-host basis in the
141 configuration files; see the
142 .Cm Compression
143 option.
144 .Pp
145 .It Fl c Ar cipher_spec
146 Selects the cipher specification for encrypting the session.
147 .Ar cipher_spec
148 is a comma-separated list of ciphers
149 listed in order of preference.
150 See the
151 .Cm Ciphers
152 keyword in
153 .Xr ssh_config 5
154 for more information.
155 .Pp
156 .It Fl D Xo
157 .Sm off
158 .Oo Ar bind_address : Oc
159 .Ar port
160 .Sm on
161 .Xc
162 Specifies a local
163 .Dq dynamic
164 application-level port forwarding.
165 This works by allocating a socket to listen to
166 .Ar port
167 on the local side, optionally bound to the specified
168 .Ar bind_address .
169 Whenever a connection is made to this port, the
170 connection is forwarded over the secure channel, and the application
171 protocol is then used to determine where to connect to from the
172 remote machine.
173 Currently the SOCKS4 and SOCKS5 protocols are supported, and
174 .Nm
175 will act as a SOCKS server.
176 Only root can forward privileged ports.
177 Dynamic port forwardings can also be specified in the configuration file.
178 .Pp
179 IPv6 addresses can be specified by enclosing the address in square brackets.
180 Only the superuser can forward privileged ports.
181 By default, the local port is bound in accordance with the
182 .Cm GatewayPorts
183 setting.
184 However, an explicit
185 .Ar bind_address
186 may be used to bind the connection to a specific address.
187 The
188 .Ar bind_address
189 of
190 .Dq localhost
191 indicates that the listening port be bound for local use only, while an
192 empty address or
193 .Sq *
194 indicates that the port should be available from all interfaces.
195 .Pp
196 .It Fl E Ar log_file
197 Append debug logs to
198 .Ar log_file
199 instead of standard error.
200 .Pp
201 .It Fl e Ar escape_char
202 Sets the escape character for sessions with a pty (default:
203 .Ql ~ ) .
204 The escape character is only recognized at the beginning of a line.
205 The escape character followed by a dot
206 .Pq Ql \&.
207 closes the connection;
208 followed by control-Z suspends the connection;
209 and followed by itself sends the escape character once.
210 Setting the character to
211 .Dq none
212 disables any escapes and makes the session fully transparent.
213 .Pp
214 .It Fl F Ar configfile
215 Specifies an alternative per-user configuration file.
216 If a configuration file is given on the command line,
217 the system-wide configuration file
218 .Pq Pa /etc/ssh/ssh_config
219 will be ignored.
220 The default for the per-user configuration file is
221 .Pa ~/.ssh/config .
222 .Pp
223 .It Fl f
224 Requests
225 .Nm
226 to go to background just before command execution.
227 This is useful if
228 .Nm
229 is going to ask for passwords or passphrases, but the user
230 wants it in the background.
231 This implies
232 .Fl n .
233 The recommended way to start X11 programs at a remote site is with
234 something like
235 .Ic ssh -f host xterm .
236 .Pp
237 If the
238 .Cm ExitOnForwardFailure
239 configuration option is set to
240 .Dq yes ,
241 then a client started with
242 .Fl f
243 will wait for all remote port forwards to be successfully established
244 before placing itself in the background.
245 .Pp
246 .It Fl G
247 Causes
248 .Nm
249 to print its configuration after evaluating
250 .Cm Host
251 and
252 .Cm Match
253 blocks and exit.
254 .Pp
255 .It Fl g
256 Allows remote hosts to connect to local forwarded ports.
257 If used on a multiplexed connection, then this option must be specified
258 on the master process.
259 .Pp
260 .It Fl I Ar pkcs11
261 Specify the PKCS#11 shared library
262 .Nm
263 should use to communicate with a PKCS#11 token providing the user's
264 private RSA key.
265 .Pp
266 .It Fl i Ar identity_file
267 Selects a file from which the identity (private key) for
268 public key authentication is read.
269 The default is
270 .Pa ~/.ssh/id_dsa ,
271 .Pa ~/.ssh/id_ecdsa ,
272 .Pa ~/.ssh/id_ed25519
273 and
274 .Pa ~/.ssh/id_rsa .
275 Identity files may also be specified on
276 a per-host basis in the configuration file.
277 It is possible to have multiple
278 .Fl i
279 options (and multiple identities specified in
280 configuration files).
281 If no certificates have been explicitly specified by the
282 .Cm CertificateFile
283 directive,
284 .Nm
285 will also try to load certificate information from the filename obtained
286 by appending
287 .Pa -cert.pub
288 to identity filenames.
289 .Pp
290 .It Fl J Xo
291 .Sm off
292 .Op Ar user No @
293 .Ar host
294 .Op : Ar port
295 .Sm on
296 .Xc
297 Connect to the target host by first making a
298 .Nm
299 connection to the jump
300 .Ar host
301 and then establishing a TCP forwarding to the ultimate destination from
302 there.
303 Multiple jump hops may be specified separated by comma characters.
304 This is a shortcut to specify a
305 .Cm ProxyJump
306 configuration directive.
307 .Pp
308 .It Fl K
309 Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI
310 credentials to the server.
311 .Pp
312 .It Fl k
313 Disables forwarding (delegation) of GSSAPI credentials to the server.
314 .Pp
315 .It Fl L Xo
316 .Sm off
317 .Oo Ar bind_address : Oc
318 .Ar port : host : hostport
319 .Sm on
320 .Xc
321 .It Fl L Xo
322 .Sm off
323 .Oo Ar bind_address : Oc
324 .Ar port : remote_socket
325 .Sm on
326 .Xc
327 .It Fl L Xo
328 .Sm off
329 .Ar local_socket : host : hostport
330 .Sm on
331 .Xc
332 .It Fl L Xo
333 .Sm off
334 .Ar local_socket : remote_socket
335 .Sm on
336 .Xc
337 Specifies that connections to the given TCP port or Unix socket on the local
338 (client) host are to be forwarded to the given host and port, or Unix socket,
339 on the remote side.
340 This works by allocating a socket to listen to either a TCP
341 .Ar port
342 on the local side, optionally bound to the specified
343 .Ar bind_address ,
344 or to a Unix socket.
345 Whenever a connection is made to the local port or socket, the
346 connection is forwarded over the secure channel, and a connection is
347 made to either
348 .Ar host
349 port
350 .Ar hostport ,
351 or the Unix socket
352 .Ar remote_socket ,
353 from the remote machine.
354 .Pp
355 Port forwardings can also be specified in the configuration file.
356 Only the superuser can forward privileged ports.
357 IPv6 addresses can be specified by enclosing the address in square brackets.
358 .Pp
359 By default, the local port is bound in accordance with the
360 .Cm GatewayPorts
361 setting.
362 However, an explicit
363 .Ar bind_address
364 may be used to bind the connection to a specific address.
365 The
366 .Ar bind_address
367 of
368 .Dq localhost
369 indicates that the listening port be bound for local use only, while an
370 empty address or
371 .Sq *
372 indicates that the port should be available from all interfaces.
373 .Pp
374 .It Fl l Ar login_name
375 Specifies the user to log in as on the remote machine.
376 This also may be specified on a per-host basis in the configuration file.
377 .Pp
378 .It Fl M
379 Places the
380 .Nm
381 client into
382 .Dq master
383 mode for connection sharing.
384 Multiple
385 .Fl M
386 options places
387 .Nm
388 into
389 .Dq master
390 mode with confirmation required before slave connections are accepted.
391 Refer to the description of
392 .Cm ControlMaster
393 in
394 .Xr ssh_config 5
395 for details.
396 .Pp
397 .It Fl m Ar mac_spec
398 A comma-separated list of MAC (message authentication code) algorithms,
399 specified in order of preference.
400 See the
401 .Cm MACs
402 keyword for more information.
403 .Pp
404 .It Fl N
405 Do not execute a remote command.
406 This is useful for just forwarding ports.
407 .Pp
408 .It Fl n
409 Redirects stdin from
410 .Pa /dev/null
411 (actually, prevents reading from stdin).
412 This must be used when
413 .Nm
414 is run in the background.
415 A common trick is to use this to run X11 programs on a remote machine.
416 For example,
417 .Ic ssh -n shadows.cs.hut.fi emacs &
418 will start an emacs on shadows.cs.hut.fi, and the X11
419 connection will be automatically forwarded over an encrypted channel.
420 The
421 .Nm
422 program will be put in the background.
423 (This does not work if
424 .Nm
425 needs to ask for a password or passphrase; see also the
426 .Fl f
427 option.)
428 .Pp
429 .It Fl O Ar ctl_cmd
430 Control an active connection multiplexing master process.
431 When the
432 .Fl O
433 option is specified, the
434 .Ar ctl_cmd
435 argument is interpreted and passed to the master process.
436 Valid commands are:
437 .Dq check
438 (check that the master process is running),
439 .Dq forward
440 (request forwardings without command execution),
441 .Dq cancel
442 (cancel forwardings),
443 .Dq exit
444 (request the master to exit), and
445 .Dq stop
446 (request the master to stop accepting further multiplexing requests).
447 .Pp
448 .It Fl o Ar option
449 Can be used to give options in the format used in the configuration file.
450 This is useful for specifying options for which there is no separate
451 command-line flag.
452 For full details of the options listed below, and their possible values, see
453 .Xr ssh_config 5 .
454 .Pp
455 .Bl -tag -width Ds -offset indent -compact
456 .It AddKeysToAgent
457 .It AddressFamily
458 .It BatchMode
459 .It BindAddress
460 .It CanonicalDomains
461 .It CanonicalizeFallbackLocal
462 .It CanonicalizeHostname
463 .It CanonicalizeMaxDots
464 .It CanonicalizePermittedCNAMEs
465 .It CertificateFile
466 .It ChallengeResponseAuthentication
467 .It CheckHostIP
468 .It Ciphers
469 .It ClearAllForwardings
470 .It Compression
471 .It ConnectionAttempts
472 .It ConnectTimeout
473 .It ControlMaster
474 .It ControlPath
475 .It ControlPersist
476 .It DynamicForward
477 .It EscapeChar
478 .It ExitOnForwardFailure
479 .It FingerprintHash
480 .It ForwardAgent
481 .It ForwardX11
482 .It ForwardX11Timeout
483 .It ForwardX11Trusted
484 .It GatewayPorts
485 .It GlobalKnownHostsFile
486 .It GSSAPIAuthentication
487 .It GSSAPIDelegateCredentials
488 .It HashKnownHosts
489 .It Host
490 .It HostbasedAuthentication
491 .It HostbasedKeyTypes
492 .It HostKeyAlgorithms
493 .It HostKeyAlias
494 .It HostName
495 .It IdentitiesOnly
496 .It IdentityAgent
497 .It IdentityFile
498 .It Include
499 .It IPQoS
500 .It KbdInteractiveAuthentication
501 .It KbdInteractiveDevices
502 .It KexAlgorithms
503 .It LocalCommand
504 .It LocalForward
505 .It LogLevel
506 .It MACs
507 .It Match
508 .It NoHostAuthenticationForLocalhost
509 .It NumberOfPasswordPrompts
510 .It PasswordAuthentication
511 .It PermitLocalCommand
512 .It PKCS11Provider
513 .It Port
514 .It PreferredAuthentications
515 .It ProxyCommand
516 .It ProxyJump
517 .It ProxyUseFdpass
518 .It PubkeyAcceptedKeyTypes
519 .It PubkeyAuthentication
520 .It RekeyLimit
521 .It RemoteCommand
522 .It RemoteForward
523 .It RequestTTY
524 .It SendEnv
525 .It ServerAliveInterval
526 .It ServerAliveCountMax
527 .It StreamLocalBindMask
528 .It StreamLocalBindUnlink
529 .It StrictHostKeyChecking
530 .It TCPKeepAlive
531 .It Tunnel
532 .It TunnelDevice
533 .It UpdateHostKeys
534 .It UsePrivilegedPort
535 .It User
536 .It UserKnownHostsFile
537 .It VerifyHostKeyDNS
538 .It VisualHostKey
539 .It XAuthLocation
540 .El
541 .Pp
542 .It Fl p Ar port
543 Port to connect to on the remote host.
544 This can be specified on a
545 per-host basis in the configuration file.
546 .Pp
547 .It Fl Q Ar query_option
548 Queries
549 .Nm
550 for the algorithms supported for the specified version 2.
551 The available features are:
552 .Ar cipher
553 (supported symmetric ciphers),
554 .Ar cipher-auth
555 (supported symmetric ciphers that support authenticated encryption),
556 .Ar mac
557 (supported message integrity codes),
558 .Ar kex
559 (key exchange algorithms),
560 .Ar key
561 (key types),
562 .Ar key-cert
563 (certificate key types),
564 .Ar key-plain
565 (non-certificate key types), and
566 .Ar protocol-version
567 (supported SSH protocol versions).
568 .Pp
569 .It Fl q
570 Quiet mode.
571 Causes most warning and diagnostic messages to be suppressed.
572 .Pp
573 .It Fl R Xo
574 .Sm off
575 .Oo Ar bind_address : Oc
576 .Ar port : host : hostport
577 .Sm on
578 .Xc
579 .It Fl R Xo
580 .Sm off
581 .Oo Ar bind_address : Oc
582 .Ar port : local_socket
583 .Sm on
584 .Xc
585 .It Fl R Xo
586 .Sm off
587 .Ar remote_socket : host : hostport
588 .Sm on
589 .Xc
590 .It Fl R Xo
591 .Sm off
592 .Ar remote_socket : local_socket
593 .Sm on
594 .Xc
595 .It Fl R Xo
596 .Sm off
597 .Oo Ar bind_address : Oc
598 .Ar port
599 .Sm on
600 .Xc
601 Specifies that connections to the given TCP port or Unix socket on the remote
602 (server) host are to be forwarded to the local side.
603 .Pp
604 This works by allocating a socket to listen to either a TCP
605 .Ar port
606 or to a Unix socket on the remote side.
607 Whenever a connection is made to this port or Unix socket, the
608 connection is forwarded over the secure channel, and a connection
609 is made from the local machine to either an explicit destination specified by
610 .Ar host
611 port
612 .Ar hostport ,
613 or
614 .Ar local_socket ,
615 or, if no explicit destination was specified,
616 .Nm
617 will act as a SOCKS 4/5 proxy and forward connections to the destinations
618 requested by the remote SOCKS client.
619 .Pp
620 Port forwardings can also be specified in the configuration file.
621 Privileged ports can be forwarded only when
622 logging in as root on the remote machine.
623 IPv6 addresses can be specified by enclosing the address in square brackets.
624 .Pp
625 By default, TCP listening sockets on the server will be bound to the loopback
626 interface only.
627 This may be overridden by specifying a
628 .Ar bind_address .
629 An empty
630 .Ar bind_address ,
631 or the address
632 .Ql * ,
633 indicates that the remote socket should listen on all interfaces.
634 Specifying a remote
635 .Ar bind_address
636 will only succeed if the server's
637 .Cm GatewayPorts
638 option is enabled (see
639 .Xr sshd_config 5 ) .
640 .Pp
641 If the
642 .Ar port
643 argument is
644 .Ql 0 ,
645 the listen port will be dynamically allocated on the server and reported
646 to the client at run time.
647 When used together with
648 .Ic -O forward
649 the allocated port will be printed to the standard output.
650 .Pp
651 .It Fl S Ar ctl_path
652 Specifies the location of a control socket for connection sharing,
653 or the string
654 .Dq none
655 to disable connection sharing.
656 Refer to the description of
657 .Cm ControlPath
658 and
659 .Cm ControlMaster
660 in
661 .Xr ssh_config 5
662 for details.
663 .Pp
664 .It Fl s
665 May be used to request invocation of a subsystem on the remote system.
666 Subsystems facilitate the use of SSH
667 as a secure transport for other applications (e.g.\&
668 .Xr sftp 1 ) .
669 The subsystem is specified as the remote command.
670 .Pp
671 .It Fl T
672 Disable pseudo-terminal allocation.
673 .Pp
674 .It Fl t
675 Force pseudo-terminal allocation.
676 This can be used to execute arbitrary
677 screen-based programs on a remote machine, which can be very useful,
678 e.g. when implementing menu services.
679 Multiple
680 .Fl t
681 options force tty allocation, even if
682 .Nm
683 has no local tty.
684 .Pp
685 .It Fl V
686 Display the version number and exit.
687 .Pp
688 .It Fl v
689 Verbose mode.
690 Causes
691 .Nm
692 to print debugging messages about its progress.
693 This is helpful in
694 debugging connection, authentication, and configuration problems.
695 Multiple
696 .Fl v
697 options increase the verbosity.
698 The maximum is 3.
699 .Pp
700 .It Fl W Ar host : Ns Ar port
701 Requests that standard input and output on the client be forwarded to
702 .Ar host
703 on
704 .Ar port
705 over the secure channel.
706 Implies
707 .Fl N ,
708 .Fl T ,
709 .Cm ExitOnForwardFailure
710 and
711 .Cm ClearAllForwardings ,
712 though these can be overridden in the configuration file or using
713 .Fl o
714 command line options.
715 .Pp
716 .It Fl w Xo
717 .Ar local_tun Ns Op : Ns Ar remote_tun
718 .Xc
719 Requests
720 tunnel
721 device forwarding with the specified
722 .Xr tun 4
723 devices between the client
724 .Pq Ar local_tun
725 and the server
726 .Pq Ar remote_tun .
727 .Pp
728 The devices may be specified by numerical ID or the keyword
729 .Dq any ,
730 which uses the next available tunnel device.
731 If
732 .Ar remote_tun
733 is not specified, it defaults to
734 .Dq any .
735 See also the
736 .Cm Tunnel
737 and
738 .Cm TunnelDevice
739 directives in
740 .Xr ssh_config 5 .
741 If the
742 .Cm Tunnel
743 directive is unset, it is set to the default tunnel mode, which is
744 .Dq point-to-point .
745 .Pp
746 .It Fl X
747 Enables X11 forwarding.
748 This can also be specified on a per-host basis in a configuration file.
749 .Pp
750 X11 forwarding should be enabled with caution.
751 Users with the ability to bypass file permissions on the remote host
752 (for the user's X authorization database)
753 can access the local X11 display through the forwarded connection.
754 An attacker may then be able to perform activities such as keystroke monitoring.
755 .Pp
756 For this reason, X11 forwarding is subjected to X11 SECURITY extension
757 restrictions by default.
758 Please refer to the
759 .Nm
760 .Fl Y
761 option and the
762 .Cm ForwardX11Trusted
763 directive in
764 .Xr ssh_config 5
765 for more information.
766 .Pp
767 .It Fl x
768 Disables X11 forwarding.
769 .Pp
770 .It Fl Y
771 Enables trusted X11 forwarding.
772 Trusted X11 forwardings are not subjected to the X11 SECURITY extension
773 controls.
774 .Pp
775 .It Fl y
776 Send log information using the
777 .Xr syslog 3
778 system module.
779 By default this information is sent to stderr.
780 .El
781 .Pp
782 .Nm
783 may additionally obtain configuration data from
784 a per-user configuration file and a system-wide configuration file.
785 The file format and configuration options are described in
786 .Xr ssh_config 5 .
787 .Sh AUTHENTICATION
788 The OpenSSH SSH client supports SSH protocol 2.
789 .Pp
790 The methods available for authentication are:
791 GSSAPI-based authentication,
792 host-based authentication,
793 public key authentication,
794 challenge-response authentication,
795 and password authentication.
796 Authentication methods are tried in the order specified above,
797 though
798 .Cm PreferredAuthentications
799 can be used to change the default order.
800 .Pp
801 Host-based authentication works as follows:
802 If the machine the user logs in from is listed in
803 .Pa /etc/hosts.equiv
804 or
805 .Pa /etc/shosts.equiv
806 on the remote machine, and the user names are
807 the same on both sides, or if the files
808 .Pa ~/.rhosts
809 or
810 .Pa ~/.shosts
811 exist in the user's home directory on the
812 remote machine and contain a line containing the name of the client
813 machine and the name of the user on that machine, the user is
814 considered for login.
815 Additionally, the server
816 .Em must
817 be able to verify the client's
818 host key (see the description of
819 .Pa /etc/ssh/ssh_known_hosts
820 and
821 .Pa ~/.ssh/known_hosts ,
822 below)
823 for login to be permitted.
824 This authentication method closes security holes due to IP
825 spoofing, DNS spoofing, and routing spoofing.
826 [Note to the administrator:
827 .Pa /etc/hosts.equiv ,
828 .Pa ~/.rhosts ,
829 and the rlogin/rsh protocol in general, are inherently insecure and should be
830 disabled if security is desired.]
831 .Pp
832 Public key authentication works as follows:
833 The scheme is based on public-key cryptography,
834 using cryptosystems
835 where encryption and decryption are done using separate keys,
836 and it is unfeasible to derive the decryption key from the encryption key.
837 The idea is that each user creates a public/private
838 key pair for authentication purposes.
839 The server knows the public key, and only the user knows the private key.
840 .Nm
841 implements public key authentication protocol automatically,
842 using one of the DSA, ECDSA, Ed25519 or RSA algorithms.
843 The HISTORY section of
844 .Xr ssl 8
845 contains a brief discussion of the DSA and RSA algorithms.
846 .Pp
847 The file
848 .Pa ~/.ssh/authorized_keys
849 lists the public keys that are permitted for logging in.
850 When the user logs in, the
851 .Nm
852 program tells the server which key pair it would like to use for
853 authentication.
854 The client proves that it has access to the private key
855 and the server checks that the corresponding public key
856 is authorized to accept the account.
857 .Pp
858 The server may inform the client of errors that prevented public key
859 authentication from succeeding after authentication completes using a
860 different method.
861 These may be viewed by increasing the
862 .Cm LogLevel
863 to
864 .Cm DEBUG
865 or higher (e.g. by using the
866 .Fl v
867 flag).
868 .Pp
869 The user creates his/her key pair by running
870 .Xr ssh-keygen 1 .
871 This stores the private key in
872 .Pa ~/.ssh/id_dsa
873 (DSA),
874 .Pa ~/.ssh/id_ecdsa
875 (ECDSA),
876 .Pa ~/.ssh/id_ed25519
877 (Ed25519),
878 or
879 .Pa ~/.ssh/id_rsa
880 (RSA)
881 and stores the public key in
882 .Pa ~/.ssh/id_dsa.pub
883 (DSA),
884 .Pa ~/.ssh/id_ecdsa.pub
885 (ECDSA),
886 .Pa ~/.ssh/id_ed25519.pub
887 (Ed25519),
888 or
889 .Pa ~/.ssh/id_rsa.pub
890 (RSA)
891 in the user's home directory.
892 The user should then copy the public key
893 to
894 .Pa ~/.ssh/authorized_keys
895 in his/her home directory on the remote machine.
896 The
897 .Pa authorized_keys
898 file corresponds to the conventional
899 .Pa ~/.rhosts
900 file, and has one key
901 per line, though the lines can be very long.
902 After this, the user can log in without giving the password.
903 .Pp
904 A variation on public key authentication
905 is available in the form of certificate authentication:
906 instead of a set of public/private keys,
907 signed certificates are used.
908 This has the advantage that a single trusted certification authority
909 can be used in place of many public/private keys.
910 See the CERTIFICATES section of
911 .Xr ssh-keygen 1
912 for more information.
913 .Pp
914 The most convenient way to use public key or certificate authentication
915 may be with an authentication agent.
916 See
917 .Xr ssh-agent 1
918 and (optionally) the
919 .Cm AddKeysToAgent
920 directive in
921 .Xr ssh_config 5
922 for more information.
923 .Pp
924 Challenge-response authentication works as follows:
925 The server sends an arbitrary
926 .Qq challenge
927 text, and prompts for a response.
928 Examples of challenge-response authentication include
929 .Bx
930 Authentication (see
931 .Xr login.conf 5 )
932 and PAM (some
933 .Pf non- Ox
934 systems).
935 .Pp
936 Finally, if other authentication methods fail,
937 .Nm
938 prompts the user for a password.
939 The password is sent to the remote
940 host for checking; however, since all communications are encrypted,
941 the password cannot be seen by someone listening on the network.
942 .Pp
943 .Nm
944 automatically maintains and checks a database containing
945 identification for all hosts it has ever been used with.
946 Host keys are stored in
947 .Pa ~/.ssh/known_hosts
948 in the user's home directory.
949 Additionally, the file
950 .Pa /etc/ssh/ssh_known_hosts
951 is automatically checked for known hosts.
952 Any new hosts are automatically added to the user's file.
953 If a host's identification ever changes,
954 .Nm
955 warns about this and disables password authentication to prevent
956 server spoofing or man-in-the-middle attacks,
957 which could otherwise be used to circumvent the encryption.
958 The
959 .Cm StrictHostKeyChecking
960 option can be used to control logins to machines whose
961 host key is not known or has changed.
962 .Pp
963 When the user's identity has been accepted by the server, the server
964 either executes the given command in a non-interactive session or,
965 if no command has been specified, logs into the machine and gives
966 the user a normal shell as an interactive session.
967 All communication with
968 the remote command or shell will be automatically encrypted.
969 .Pp
970 If an interactive session is requested
971 .Nm
972 by default will only request a pseudo-terminal (pty) for interactive
973 sessions when the client has one.
974 The flags
975 .Fl T
976 and
977 .Fl t
978 can be used to override this behaviour.
979 .Pp
980 If a pseudo-terminal has been allocated the
981 user may use the escape characters noted below.
982 .Pp
983 If no pseudo-terminal has been allocated,
984 the session is transparent and can be used to reliably transfer binary data.
985 On most systems, setting the escape character to
986 .Dq none
987 will also make the session transparent even if a tty is used.
988 .Pp
989 The session terminates when the command or shell on the remote
990 machine exits and all X11 and TCP connections have been closed.
991 .Sh ESCAPE CHARACTERS
992 When a pseudo-terminal has been requested,
993 .Nm
994 supports a number of functions through the use of an escape character.
995 .Pp
996 A single tilde character can be sent as
997 .Ic ~~
998 or by following the tilde by a character other than those described below.
999 The escape character must always follow a newline to be interpreted as
1000 special.
1001 The escape character can be changed in configuration files using the
1002 .Cm EscapeChar
1003 configuration directive or on the command line by the
1004 .Fl e
1005 option.
1006 .Pp
1007 The supported escapes (assuming the default
1008 .Ql ~ )
1009 are:
1010 .Bl -tag -width Ds
1011 .It Cm ~.
1012 Disconnect.
1013 .It Cm ~^Z
1014 Background
1015 .Nm .
1016 .It Cm ~#
1017 List forwarded connections.
1018 .It Cm ~&
1019 Background
1020 .Nm
1021 at logout when waiting for forwarded connection / X11 sessions to terminate.
1022 .It Cm ~?
1023 Display a list of escape characters.
1024 .It Cm ~B
1025 Send a BREAK to the remote system
1026 (only useful if the peer supports it).
1027 .It Cm ~C
1028 Open command line.
1029 Currently this allows the addition of port forwardings using the
1030 .Fl L ,
1031 .Fl R
1032 and
1033 .Fl D
1034 options (see above).
1035 It also allows the cancellation of existing port-forwardings
1036 with
1037 .Sm off
1038 .Fl KL Oo Ar bind_address : Oc Ar port
1039 .Sm on
1040 for local,
1041 .Sm off
1042 .Fl KR Oo Ar bind_address : Oc Ar port
1043 .Sm on
1044 for remote and
1045 .Sm off
1046 .Fl KD Oo Ar bind_address : Oc Ar port
1047 .Sm on
1048 for dynamic port-forwardings.
1049 .Ic !\& Ns Ar command
1050 allows the user to execute a local command if the
1051 .Ic PermitLocalCommand
1052 option is enabled in
1053 .Xr ssh_config 5 .
1054 Basic help is available, using the
1055 .Fl h
1056 option.
1057 .It Cm ~R
1058 Request rekeying of the connection
1059 (only useful if the peer supports it).
1060 .It Cm ~V
1061 Decrease the verbosity
1062 .Pq Ic LogLevel
1063 when errors are being written to stderr.
1064 .It Cm ~v
1065 Increase the verbosity
1066 .Pq Ic LogLevel
1067 when errors are being written to stderr.
1068 .El
1069 .Sh TCP FORWARDING
1070 Forwarding of arbitrary TCP connections over the secure channel can
1071 be specified either on the command line or in a configuration file.
1072 One possible application of TCP forwarding is a secure connection to a
1073 mail server; another is going through firewalls.
1074 .Pp
1075 In the example below, we look at encrypting communication between
1076 an IRC client and server, even though the IRC server does not directly
1077 support encrypted communications.
1078 This works as follows:
1079 the user connects to the remote host using
1080 .Nm ,
1081 specifying a port to be used to forward connections
1082 to the remote server.
1083 After that it is possible to start the service which is to be encrypted
1084 on the client machine,
1085 connecting to the same local port,
1086 and
1087 .Nm
1088 will encrypt and forward the connection.
1089 .Pp
1090 The following example tunnels an IRC session from client machine
1091 .Dq 127.0.0.1
1092 (localhost)
1093 to remote server
1094 .Dq server.example.com :
1095 .Bd -literal -offset 4n
1096 $ ssh -f -L 1234:localhost:6667 server.example.com sleep 10
1097 $ irc -c '#users' -p 1234 pinky 127.0.0.1
1098 .Ed
1099 .Pp
1100 This tunnels a connection to IRC server
1101 .Dq server.example.com ,
1102 joining channel
1103 .Dq #users ,
1104 nickname
1105 .Dq pinky ,
1106 using port 1234.
1107 It doesn't matter which port is used,
1108 as long as it's greater than 1023
1109 (remember, only root can open sockets on privileged ports)
1110 and doesn't conflict with any ports already in use.
1111 The connection is forwarded to port 6667 on the remote server,
1112 since that's the standard port for IRC services.
1113 .Pp
1114 The
1115 .Fl f
1116 option backgrounds
1117 .Nm
1118 and the remote command
1119 .Dq sleep 10
1120 is specified to allow an amount of time
1121 (10 seconds, in the example)
1122 to start the service which is to be tunnelled.
1123 If no connections are made within the time specified,
1124 .Nm
1125 will exit.
1126 .Sh X11 FORWARDING
1127 If the
1128 .Cm ForwardX11
1129 variable is set to
1130 .Dq yes
1131 (or see the description of the
1132 .Fl X ,
1133 .Fl x ,
1134 and
1135 .Fl Y
1136 options above)
1137 and the user is using X11 (the
1138 .Ev DISPLAY
1139 environment variable is set), the connection to the X11 display is
1140 automatically forwarded to the remote side in such a way that any X11
1141 programs started from the shell (or command) will go through the
1142 encrypted channel, and the connection to the real X server will be made
1143 from the local machine.
1144 The user should not manually set
1145 .Ev DISPLAY .
1146 Forwarding of X11 connections can be
1147 configured on the command line or in configuration files.
1148 .Pp
1149 The
1150 .Ev DISPLAY
1151 value set by
1152 .Nm
1153 will point to the server machine, but with a display number greater than zero.
1154 This is normal, and happens because
1155 .Nm
1156 creates a
1157 .Dq proxy
1158 X server on the server machine for forwarding the
1159 connections over the encrypted channel.
1160 .Pp
1161 .Nm
1162 will also automatically set up Xauthority data on the server machine.
1163 For this purpose, it will generate a random authorization cookie,
1164 store it in Xauthority on the server, and verify that any forwarded
1165 connections carry this cookie and replace it by the real cookie when
1166 the connection is opened.
1167 The real authentication cookie is never
1168 sent to the server machine (and no cookies are sent in the plain).
1169 .Pp
1170 If the
1171 .Cm ForwardAgent
1172 variable is set to
1173 .Dq yes
1174 (or see the description of the
1175 .Fl A
1176 and
1177 .Fl a
1178 options above) and
1179 the user is using an authentication agent, the connection to the agent
1180 is automatically forwarded to the remote side.
1181 .Sh VERIFYING HOST KEYS
1182 When connecting to a server for the first time,
1183 a fingerprint of the server's public key is presented to the user
1184 (unless the option
1185 .Cm StrictHostKeyChecking
1186 has been disabled).
1187 Fingerprints can be determined using
1188 .Xr ssh-keygen 1 :
1189 .Pp
1190 .Dl $ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key
1191 .Pp
1192 If the fingerprint is already known, it can be matched
1193 and the key can be accepted or rejected.
1194 If only legacy (MD5) fingerprints for the server are available, the
1195 .Xr ssh-keygen 1
1196 .Fl E
1197 option may be used to downgrade the fingerprint algorithm to match.
1198 .Pp
1199 Because of the difficulty of comparing host keys
1200 just by looking at fingerprint strings,
1201 there is also support to compare host keys visually,
1202 using
1203 .Em random art .
1204 By setting the
1205 .Cm VisualHostKey
1206 option to
1207 .Dq yes ,
1208 a small ASCII graphic gets displayed on every login to a server, no matter
1209 if the session itself is interactive or not.
1210 By learning the pattern a known server produces, a user can easily
1211 find out that the host key has changed when a completely different pattern
1212 is displayed.
1213 Because these patterns are not unambiguous however, a pattern that looks
1214 similar to the pattern remembered only gives a good probability that the
1215 host key is the same, not guaranteed proof.
1216 .Pp
1217 To get a listing of the fingerprints along with their random art for
1218 all known hosts, the following command line can be used:
1219 .Pp
1220 .Dl $ ssh-keygen -lv -f ~/.ssh/known_hosts
1221 .Pp
1222 If the fingerprint is unknown,
1223 an alternative method of verification is available:
1224 SSH fingerprints verified by DNS.
1225 An additional resource record (RR),
1226 SSHFP,
1227 is added to a zonefile
1228 and the connecting client is able to match the fingerprint
1229 with that of the key presented.
1230 .Pp
1231 In this example, we are connecting a client to a server,
1232 .Dq host.example.com .
1233 The SSHFP resource records should first be added to the zonefile for
1234 host.example.com:
1235 .Bd -literal -offset indent
1236 $ ssh-keygen -r host.example.com.
1237 .Ed
1238 .Pp
1239 The output lines will have to be added to the zonefile.
1240 To check that the zone is answering fingerprint queries:
1241 .Pp
1242 .Dl $ dig -t SSHFP host.example.com
1243 .Pp
1244 Finally the client connects:
1245 .Bd -literal -offset indent
1246 $ ssh -o "VerifyHostKeyDNS ask" host.example.com
1247 [...]
1248 Matching host key fingerprint found in DNS.
1249 Are you sure you want to continue connecting (yes/no)?
1250 .Ed
1251 .Pp
1252 See the
1253 .Cm VerifyHostKeyDNS
1254 option in
1255 .Xr ssh_config 5
1256 for more information.
1257 .Sh SSH-BASED VIRTUAL PRIVATE NETWORKS
1258 .Nm
1259 contains support for Virtual Private Network (VPN) tunnelling
1260 using the
1261 .Xr tun 4
1262 network pseudo-device,
1263 allowing two networks to be joined securely.
1264 The
1265 .Xr sshd_config 5
1266 configuration option
1267 .Cm PermitTunnel
1268 controls whether the server supports this,
1269 and at what level (layer 2 or 3 traffic).
1270 .Pp
1271 The following example would connect client network 10.0.50.0/24
1272 with remote network 10.0.99.0/24 using a point-to-point connection
1273 from 10.1.1.1 to 10.1.1.2,
1274 provided that the SSH server running on the gateway to the remote network,
1275 at 192.168.1.15, allows it.
1276 .Pp
1277 On the client:
1278 .Bd -literal -offset indent
1279 # ssh -f -w 0:1 192.168.1.15 true
1280 # ifconfig tun0 10.1.1.1 10.1.1.2 netmask 255.255.255.252
1281 # route add 10.0.99.0/24 10.1.1.2
1282 .Ed
1283 .Pp
1284 On the server:
1285 .Bd -literal -offset indent
1286 # ifconfig tun1 10.1.1.2 10.1.1.1 netmask 255.255.255.252
1287 # route add 10.0.50.0/24 10.1.1.1
1288 .Ed
1289 .Pp
1290 Client access may be more finely tuned via the
1291 .Pa /root/.ssh/authorized_keys
1292 file (see below) and the
1293 .Cm PermitRootLogin
1294 server option.
1295 The following entry would permit connections on
1296 .Xr tun 4
1297 device 1 from user
1298 .Dq jane
1299 and on tun device 2 from user
1300 .Dq john ,
1301 if
1302 .Cm PermitRootLogin
1303 is set to
1304 .Dq forced-commands-only :
1305 .Bd -literal -offset 2n
1306 tunnel="1",command="sh /etc/netstart tun1" ssh-rsa ... jane
1307 tunnel="2",command="sh /etc/netstart tun2" ssh-rsa ... john
1308 .Ed
1309 .Pp
1310 Since an SSH-based setup entails a fair amount of overhead,
1311 it may be more suited to temporary setups,
1312 such as for wireless VPNs.
1313 More permanent VPNs are better provided by tools such as
1314 .Xr ipsecctl 8
1315 and
1316 .Xr isakmpd 8 .
1317 .Sh ENVIRONMENT
1318 .Nm
1319 will normally set the following environment variables:
1320 .Bl -tag -width "SSH_ORIGINAL_COMMAND"
1321 .It Ev DISPLAY
1322 The
1323 .Ev DISPLAY
1324 variable indicates the location of the X11 server.
1325 It is automatically set by
1326 .Nm
1327 to point to a value of the form
1328 .Dq hostname:n ,
1329 where
1330 .Dq hostname
1331 indicates the host where the shell runs, and
1332 .Sq n
1333 is an integer \*(Ge 1.
1334 .Nm
1335 uses this special value to forward X11 connections over the secure
1336 channel.
1337 The user should normally not set
1338 .Ev DISPLAY
1339 explicitly, as that
1340 will render the X11 connection insecure (and will require the user to
1341 manually copy any required authorization cookies).
1342 .It Ev HOME
1343 Set to the path of the user's home directory.
1344 .It Ev LOGNAME
1345 Synonym for
1346 .Ev USER ;
1347 set for compatibility with systems that use this variable.
1348 .It Ev MAIL
1349 Set to the path of the user's mailbox.
1350 .It Ev PATH
1351 Set to the default
1352 .Ev PATH ,
1353 as specified when compiling
1354 .Nm .
1355 .It Ev SSH_ASKPASS
1356 If
1357 .Nm
1358 needs a passphrase, it will read the passphrase from the current
1359 terminal if it was run from a terminal.
1360 If
1361 .Nm
1362 does not have a terminal associated with it but
1363 .Ev DISPLAY
1364 and
1365 .Ev SSH_ASKPASS
1366 are set, it will execute the program specified by
1367 .Ev SSH_ASKPASS
1368 and open an X11 window to read the passphrase.
1369 This is particularly useful when calling
1370 .Nm
1371 from a
1372 .Pa .xsession
1373 or related script.
1374 (Note that on some machines it
1375 may be necessary to redirect the input from
1376 .Pa /dev/null
1377 to make this work.)
1378 .It Ev SSH_AUTH_SOCK
1379 Identifies the path of a
1380 .Ux Ns -domain
1381 socket used to communicate with the agent.
1382 .It Ev SSH_CONNECTION
1383 Identifies the client and server ends of the connection.
1384 The variable contains
1385 four space-separated values: client IP address, client port number,
1386 server IP address, and server port number.
1387 .It Ev SSH_ORIGINAL_COMMAND
1388 This variable contains the original command line if a forced command
1389 is executed.
1390 It can be used to extract the original arguments.
1391 .It Ev SSH_TTY
1392 This is set to the name of the tty (path to the device) associated
1393 with the current shell or command.
1394 If the current session has no tty,
1395 this variable is not set.
1396 .It Ev TZ
1397 This variable is set to indicate the present time zone if it
1398 was set when the daemon was started (i.e. the daemon passes the value
1399 on to new connections).
1400 .It Ev USER
1401 Set to the name of the user logging in.
1402 .El
1403 .Pp
1404 Additionally,
1405 .Nm
1406 reads
1407 .Pa ~/.ssh/environment ,
1408 and adds lines of the format
1409 .Dq VARNAME=value
1410 to the environment if the file exists and users are allowed to
1411 change their environment.
1412 For more information, see the
1413 .Cm PermitUserEnvironment
1414 option in
1415 .Xr sshd_config 5 .
1416 .Sh FILES
1417 .Bl -tag -width Ds -compact
1418 .It Pa ~/.rhosts
1419 This file is used for host-based authentication (see above).
1420 On some machines this file may need to be
1421 world-readable if the user's home directory is on an NFS partition,
1422 because
1423 .Xr sshd 8
1424 reads it as root.
1425 Additionally, this file must be owned by the user,
1426 and must not have write permissions for anyone else.
1427 The recommended
1428 permission for most machines is read/write for the user, and not
1429 accessible by others.
1430 .Pp
1431 .It Pa ~/.shosts
1432 This file is used in exactly the same way as
1433 .Pa .rhosts ,
1434 but allows host-based authentication without permitting login with
1435 rlogin/rsh.
1436 .Pp
1437 .It Pa ~/.ssh/
1438 This directory is the default location for all user-specific configuration
1439 and authentication information.
1440 There is no general requirement to keep the entire contents of this directory
1441 secret, but the recommended permissions are read/write/execute for the user,
1442 and not accessible by others.
1443 .Pp
1444 .It Pa ~/.ssh/authorized_keys
1445 Lists the public keys (DSA, ECDSA, Ed25519, RSA)
1446 that can be used for logging in as this user.
1447 The format of this file is described in the
1448 .Xr sshd 8
1449 manual page.
1450 This file is not highly sensitive, but the recommended
1451 permissions are read/write for the user, and not accessible by others.
1452 .Pp
1453 .It Pa ~/.ssh/config
1454 This is the per-user configuration file.
1455 The file format and configuration options are described in
1456 .Xr ssh_config 5 .
1457 Because of the potential for abuse, this file must have strict permissions:
1458 read/write for the user, and not writable by others.
1459 .Pp
1460 .It Pa ~/.ssh/environment
1461 Contains additional definitions for environment variables; see
1462 .Sx ENVIRONMENT ,
1463 above.
1464 .Pp
1465 .It Pa ~/.ssh/id_dsa
1466 .It Pa ~/.ssh/id_ecdsa
1467 .It Pa ~/.ssh/id_ed25519
1468 .It Pa ~/.ssh/id_rsa
1469 Contains the private key for authentication.
1470 These files
1471 contain sensitive data and should be readable by the user but not
1472 accessible by others (read/write/execute).
1473 .Nm
1474 will simply ignore a private key file if it is accessible by others.
1475 It is possible to specify a passphrase when
1476 generating the key which will be used to encrypt the
1477 sensitive part of this file using 3DES.
1478 .Pp
1479 .It Pa ~/.ssh/id_dsa.pub
1480 .It Pa ~/.ssh/id_ecdsa.pub
1481 .It Pa ~/.ssh/id_ed25519.pub
1482 .It Pa ~/.ssh/id_rsa.pub
1483 Contains the public key for authentication.
1484 These files are not
1485 sensitive and can (but need not) be readable by anyone.
1486 .Pp
1487 .It Pa ~/.ssh/known_hosts
1488 Contains a list of host keys for all hosts the user has logged into
1489 that are not already in the systemwide list of known host keys.
1490 See
1491 .Xr sshd 8
1492 for further details of the format of this file.
1493 .Pp
1494 .It Pa ~/.ssh/rc
1495 Commands in this file are executed by
1496 .Nm
1497 when the user logs in, just before the user's shell (or command) is
1498 started.
1499 See the
1500 .Xr sshd 8
1501 manual page for more information.
1502 .Pp
1503 .It Pa /etc/hosts.equiv
1504 This file is for host-based authentication (see above).
1505 It should only be writable by root.
1506 .Pp
1507 .It Pa /etc/shosts.equiv
1508 This file is used in exactly the same way as
1509 .Pa hosts.equiv ,
1510 but allows host-based authentication without permitting login with
1511 rlogin/rsh.
1512 .Pp
1513 .It Pa /etc/ssh/ssh_config
1514 Systemwide configuration file.
1515 The file format and configuration options are described in
1516 .Xr ssh_config 5 .
1517 .Pp
1518 .It Pa /etc/ssh/ssh_host_key
1519 .It Pa /etc/ssh/ssh_host_dsa_key
1520 .It Pa /etc/ssh/ssh_host_ecdsa_key
1521 .It Pa /etc/ssh/ssh_host_ed25519_key
1522 .It Pa /etc/ssh/ssh_host_rsa_key
1523 These files contain the private parts of the host keys
1524 and are used for host-based authentication.
1525 .Pp
1526 .It Pa /etc/ssh/ssh_known_hosts
1527 Systemwide list of known host keys.
1528 This file should be prepared by the
1529 system administrator to contain the public host keys of all machines in the
1530 organization.
1531 It should be world-readable.
1532 See
1533 .Xr sshd 8
1534 for further details of the format of this file.
1535 .Pp
1536 .It Pa /etc/ssh/sshrc
1537 Commands in this file are executed by
1538 .Nm
1539 when the user logs in, just before the user's shell (or command) is started.
1540 See the
1541 .Xr sshd 8
1542 manual page for more information.
1543 .El
1544 .Sh EXIT STATUS
1545 .Nm
1546 exits with the exit status of the remote command or with 255
1547 if an error occurred.
1548 .Sh SEE ALSO
1549 .Xr scp 1 ,
1550 .Xr sftp 1 ,
1551 .Xr ssh-add 1 ,
1552 .Xr ssh-agent 1 ,
1553 .Xr ssh-keygen 1 ,
1554 .Xr ssh-keyscan 1 ,
1555 .Xr tun 4 ,
1556 .Xr ssh_config 5 ,
1557 .Xr ssh-keysign 8 ,
1558 .Xr sshd 8
1559 .Sh STANDARDS
1560 .Rs
1561 .%A S. Lehtinen
1562 .%A C. Lonvick
1563 .%D January 2006
1564 .%R RFC 4250
1565 .%T The Secure Shell (SSH) Protocol Assigned Numbers
1566 .Re
1567 .Pp
1568 .Rs
1569 .%A T. Ylonen
1570 .%A C. Lonvick
1571 .%D January 2006
1572 .%R RFC 4251
1573 .%T The Secure Shell (SSH) Protocol Architecture
1574 .Re
1575 .Pp
1576 .Rs
1577 .%A T. Ylonen
1578 .%A C. Lonvick
1579 .%D January 2006
1580 .%R RFC 4252
1581 .%T The Secure Shell (SSH) Authentication Protocol
1582 .Re
1583 .Pp
1584 .Rs
1585 .%A T. Ylonen
1586 .%A C. Lonvick
1587 .%D January 2006
1588 .%R RFC 4253
1589 .%T The Secure Shell (SSH) Transport Layer Protocol
1590 .Re
1591 .Pp
1592 .Rs
1593 .%A T. Ylonen
1594 .%A C. Lonvick
1595 .%D January 2006
1596 .%R RFC 4254
1597 .%T The Secure Shell (SSH) Connection Protocol
1598 .Re
1599 .Pp
1600 .Rs
1601 .%A J. Schlyter
1602 .%A W. Griffin
1603 .%D January 2006
1604 .%R RFC 4255
1605 .%T Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints
1606 .Re
1607 .Pp
1608 .Rs
1609 .%A F. Cusack
1610 .%A M. Forssen
1611 .%D January 2006
1612 .%R RFC 4256
1613 .%T Generic Message Exchange Authentication for the Secure Shell Protocol (SSH)
1614 .Re
1615 .Pp
1616 .Rs
1617 .%A J. Galbraith
1618 .%A P. Remaker
1619 .%D January 2006
1620 .%R RFC 4335
1621 .%T The Secure Shell (SSH) Session Channel Break Extension
1622 .Re
1623 .Pp
1624 .Rs
1625 .%A M. Bellare
1626 .%A T. Kohno
1627 .%A C. Namprempre
1628 .%D January 2006
1629 .%R RFC 4344
1630 .%T The Secure Shell (SSH) Transport Layer Encryption Modes
1631 .Re
1632 .Pp
1633 .Rs
1634 .%A B. Harris
1635 .%D January 2006
1636 .%R RFC 4345
1637 .%T Improved Arcfour Modes for the Secure Shell (SSH) Transport Layer Protocol
1638 .Re
1639 .Pp
1640 .Rs
1641 .%A M. Friedl
1642 .%A N. Provos
1643 .%A W. Simpson
1644 .%D March 2006
1645 .%R RFC 4419
1646 .%T Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol
1647 .Re
1648 .Pp
1649 .Rs
1650 .%A J. Galbraith
1651 .%A R. Thayer
1652 .%D November 2006
1653 .%R RFC 4716
1654 .%T The Secure Shell (SSH) Public Key File Format
1655 .Re
1656 .Pp
1657 .Rs
1658 .%A D. Stebila
1659 .%A J. Green
1660 .%D December 2009
1661 .%R RFC 5656
1662 .%T Elliptic Curve Algorithm Integration in the Secure Shell Transport Layer
1663 .Re
1664 .Pp
1665 .Rs
1666 .%A A. Perrig
1667 .%A D. Song
1668 .%D 1999
1669 .%O International Workshop on Cryptographic Techniques and E-Commerce (CrypTEC '99)
1670 .%T Hash Visualization: a New Technique to improve Real-World Security
1671 .Re
1672 .Sh AUTHORS
1673 OpenSSH is a derivative of the original and free
1674 ssh 1.2.12 release by Tatu Ylonen.
1675 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1676 Theo de Raadt and Dug Song
1677 removed many bugs, re-added newer features and
1678 created OpenSSH.
1679 Markus Friedl contributed the support for SSH
1680 protocol versions 1.5 and 2.0.