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