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