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