xref: /dflybsd-src/crypto/openssh/ssh.1 (revision ba1276acd1c8c22d225b1bcf370a14c878644f44)
118de8d7fSPeter Avalos.\"
218de8d7fSPeter Avalos.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
318de8d7fSPeter Avalos.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
418de8d7fSPeter Avalos.\"                    All rights reserved
518de8d7fSPeter Avalos.\"
618de8d7fSPeter Avalos.\" As far as I am concerned, the code I have written for this software
718de8d7fSPeter Avalos.\" can be used freely for any purpose.  Any derived versions of this
818de8d7fSPeter Avalos.\" software must be clearly marked as such, and if the derived work is
918de8d7fSPeter Avalos.\" incompatible with the protocol description in the RFC file, it must be
1018de8d7fSPeter Avalos.\" called by a name other than "ssh" or "Secure Shell".
1118de8d7fSPeter Avalos.\"
1218de8d7fSPeter Avalos.\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
1318de8d7fSPeter Avalos.\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
1418de8d7fSPeter Avalos.\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
1518de8d7fSPeter Avalos.\"
1618de8d7fSPeter Avalos.\" Redistribution and use in source and binary forms, with or without
1718de8d7fSPeter Avalos.\" modification, are permitted provided that the following conditions
1818de8d7fSPeter Avalos.\" are met:
1918de8d7fSPeter Avalos.\" 1. Redistributions of source code must retain the above copyright
2018de8d7fSPeter Avalos.\"    notice, this list of conditions and the following disclaimer.
2118de8d7fSPeter Avalos.\" 2. Redistributions in binary form must reproduce the above copyright
2218de8d7fSPeter Avalos.\"    notice, this list of conditions and the following disclaimer in the
2318de8d7fSPeter Avalos.\"    documentation and/or other materials provided with the distribution.
2418de8d7fSPeter Avalos.\"
2518de8d7fSPeter Avalos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2618de8d7fSPeter Avalos.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2718de8d7fSPeter Avalos.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2818de8d7fSPeter Avalos.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2918de8d7fSPeter Avalos.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3018de8d7fSPeter Avalos.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3118de8d7fSPeter Avalos.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3218de8d7fSPeter Avalos.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3318de8d7fSPeter Avalos.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3418de8d7fSPeter Avalos.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3518de8d7fSPeter Avalos.\"
36*ba1276acSMatthew Dillon.\" $OpenBSD: ssh.1,v 1.442 2024/06/27 21:02:16 jmc Exp $
37*ba1276acSMatthew Dillon.Dd $Mdocdate: June 27 2024 $
3818de8d7fSPeter Avalos.Dt SSH 1
3918de8d7fSPeter Avalos.Os
4018de8d7fSPeter Avalos.Sh NAME
4118de8d7fSPeter Avalos.Nm ssh
420cbfa66cSDaniel Fojt.Nd OpenSSH remote login client
4318de8d7fSPeter Avalos.Sh SYNOPSIS
4418de8d7fSPeter Avalos.Nm ssh
45ce74bacaSMatthew Dillon.Op Fl 46AaCfGgKkMNnqsTtVvXxYy
46664f4763Szrj.Op Fl B Ar bind_interface
4718de8d7fSPeter Avalos.Op Fl b Ar bind_address
4818de8d7fSPeter Avalos.Op Fl c Ar cipher_spec
49856ea928SPeter Avalos.Op Fl D Oo Ar bind_address : Oc Ns Ar port
5036e94dc5SPeter Avalos.Op Fl E Ar log_file
5118de8d7fSPeter Avalos.Op Fl e Ar escape_char
5218de8d7fSPeter Avalos.Op Fl F Ar configfile
53856ea928SPeter Avalos.Op Fl I Ar pkcs11
5418de8d7fSPeter Avalos.Op Fl i Ar identity_file
55664f4763Szrj.Op Fl J Ar destination
56e9778795SPeter Avalos.Op Fl L Ar address
5718de8d7fSPeter Avalos.Op Fl l Ar login_name
5818de8d7fSPeter Avalos.Op Fl m Ar mac_spec
5918de8d7fSPeter Avalos.Op Fl O Ar ctl_cmd
6018de8d7fSPeter Avalos.Op Fl o Ar option
61*ba1276acSMatthew Dillon.Op Fl P Ar tag
6218de8d7fSPeter Avalos.Op Fl p Ar port
63e9778795SPeter Avalos.Op Fl R Ar address
6418de8d7fSPeter Avalos.Op Fl S Ar ctl_path
65856ea928SPeter Avalos.Op Fl W Ar host : Ns Ar port
66856ea928SPeter Avalos.Op Fl w Ar local_tun Ns Op : Ns Ar remote_tun
67664f4763Szrj.Ar destination
6850a69bb5SSascha Wildner.Op Ar command Op Ar argument ...
69*ba1276acSMatthew Dillon.Nm
70*ba1276acSMatthew Dillon.Op Fl Q Ar query_option
7118de8d7fSPeter Avalos.Sh DESCRIPTION
7218de8d7fSPeter Avalos.Nm
7318de8d7fSPeter Avalos(SSH client) is a program for logging into a remote machine and for
7418de8d7fSPeter Avalosexecuting commands on a remote machine.
75e9778795SPeter AvalosIt is intended to provide secure encrypted communications between
7618de8d7fSPeter Avalostwo untrusted hosts over an insecure network.
7736e94dc5SPeter AvalosX11 connections, arbitrary TCP ports and
7836e94dc5SPeter Avalos.Ux Ns -domain
7936e94dc5SPeter Avalossockets can also be forwarded over the secure channel.
8018de8d7fSPeter Avalos.Pp
8118de8d7fSPeter Avalos.Nm
8218de8d7fSPeter Avalosconnects and logs into the specified
83664f4763Szrj.Ar destination ,
84664f4763Szrjwhich may be specified as either
85664f4763Szrj.Sm off
86664f4763Szrj.Oo user @ Oc hostname
87664f4763Szrj.Sm on
88664f4763Szrjor a URI of the form
89664f4763Szrj.Sm off
90664f4763Szrj.No ssh:// Oo user @ Oc hostname Op : port .
91664f4763Szrj.Sm on
9218de8d7fSPeter AvalosThe user must prove
9350a69bb5SSascha Wildnertheir identity to the remote machine using one of several methods
94e9778795SPeter Avalos(see below).
9518de8d7fSPeter Avalos.Pp
96664f4763SzrjIf a
9718de8d7fSPeter Avalos.Ar command
9818de8d7fSPeter Avalosis specified,
9950a69bb5SSascha Wildnerit will be executed on the remote host instead of a login shell.
10050a69bb5SSascha WildnerA complete command line may be specified as
10150a69bb5SSascha Wildner.Ar command ,
10250a69bb5SSascha Wildneror it may have additional arguments.
10350a69bb5SSascha WildnerIf supplied, the arguments will be appended to the command, separated by
10450a69bb5SSascha Wildnerspaces, before it is sent to the server to be executed.
10518de8d7fSPeter Avalos.Pp
10618de8d7fSPeter AvalosThe options are as follows:
107e9778795SPeter Avalos.Pp
108e9778795SPeter Avalos.Bl -tag -width Ds -compact
10918de8d7fSPeter Avalos.It Fl 4
11018de8d7fSPeter AvalosForces
11118de8d7fSPeter Avalos.Nm
11218de8d7fSPeter Avalosto use IPv4 addresses only.
113e9778795SPeter Avalos.Pp
11418de8d7fSPeter Avalos.It Fl 6
11518de8d7fSPeter AvalosForces
11618de8d7fSPeter Avalos.Nm
11718de8d7fSPeter Avalosto use IPv6 addresses only.
118e9778795SPeter Avalos.Pp
11918de8d7fSPeter Avalos.It Fl A
1200cbfa66cSDaniel FojtEnables forwarding of connections from an authentication agent such as
1210cbfa66cSDaniel Fojt.Xr ssh-agent 1 .
12218de8d7fSPeter AvalosThis can also be specified on a per-host basis in a configuration file.
12318de8d7fSPeter Avalos.Pp
12418de8d7fSPeter AvalosAgent forwarding should be enabled with caution.
12518de8d7fSPeter AvalosUsers with the ability to bypass file permissions on the remote host
126856ea928SPeter Avalos(for the agent's
127856ea928SPeter Avalos.Ux Ns -domain
128856ea928SPeter Avalossocket) can access the local agent through the forwarded connection.
12918de8d7fSPeter AvalosAn attacker cannot obtain key material from the agent,
13018de8d7fSPeter Avaloshowever they can perform operations on the keys that enable them to
13118de8d7fSPeter Avalosauthenticate using the identities loaded into the agent.
1320cbfa66cSDaniel FojtA safer alternative may be to use a jump host
1330cbfa66cSDaniel Fojt(see
1340cbfa66cSDaniel Fojt.Fl J ) .
135e9778795SPeter Avalos.Pp
13618de8d7fSPeter Avalos.It Fl a
13718de8d7fSPeter AvalosDisables forwarding of the authentication agent connection.
138e9778795SPeter Avalos.Pp
139664f4763Szrj.It Fl B Ar bind_interface
140664f4763SzrjBind to the address of
141664f4763Szrj.Ar bind_interface
142664f4763Szrjbefore attempting to connect to the destination host.
143664f4763SzrjThis is only useful on systems with more than one address.
144664f4763Szrj.Pp
14518de8d7fSPeter Avalos.It Fl b Ar bind_address
14618de8d7fSPeter AvalosUse
14718de8d7fSPeter Avalos.Ar bind_address
14818de8d7fSPeter Avaloson the local machine as the source address
14918de8d7fSPeter Avalosof the connection.
15018de8d7fSPeter AvalosOnly useful on systems with more than one address.
151e9778795SPeter Avalos.Pp
15218de8d7fSPeter Avalos.It Fl C
15318de8d7fSPeter AvalosRequests compression of all data (including stdin, stdout, stderr, and
15436e94dc5SPeter Avalosdata for forwarded X11, TCP and
15536e94dc5SPeter Avalos.Ux Ns -domain
15636e94dc5SPeter Avalosconnections).
15718de8d7fSPeter AvalosThe compression algorithm is the same used by
158ce74bacaSMatthew Dillon.Xr gzip 1 .
15918de8d7fSPeter AvalosCompression is desirable on modem lines and other
16018de8d7fSPeter Avalosslow connections, but will only slow down things on fast networks.
16118de8d7fSPeter AvalosThe default value can be set on a host-by-host basis in the
16218de8d7fSPeter Avalosconfiguration files; see the
16318de8d7fSPeter Avalos.Cm Compression
164ee116499SAntonio Huete Jimenezoption in
165ee116499SAntonio Huete Jimenez.Xr ssh_config 5 .
166e9778795SPeter Avalos.Pp
16718de8d7fSPeter Avalos.It Fl c Ar cipher_spec
16818de8d7fSPeter AvalosSelects the cipher specification for encrypting the session.
16918de8d7fSPeter Avalos.Ar cipher_spec
17018de8d7fSPeter Avalosis a comma-separated list of ciphers
17118de8d7fSPeter Avaloslisted in order of preference.
17240c002afSPeter AvalosSee the
17340c002afSPeter Avalos.Cm Ciphers
174856ea928SPeter Avaloskeyword in
175856ea928SPeter Avalos.Xr ssh_config 5
176856ea928SPeter Avalosfor more information.
177e9778795SPeter Avalos.Pp
17818de8d7fSPeter Avalos.It Fl D Xo
17918de8d7fSPeter Avalos.Sm off
18018de8d7fSPeter Avalos.Oo Ar bind_address : Oc
18118de8d7fSPeter Avalos.Ar port
18218de8d7fSPeter Avalos.Sm on
18318de8d7fSPeter Avalos.Xc
18418de8d7fSPeter AvalosSpecifies a local
18518de8d7fSPeter Avalos.Dq dynamic
18618de8d7fSPeter Avalosapplication-level port forwarding.
18718de8d7fSPeter AvalosThis works by allocating a socket to listen to
18818de8d7fSPeter Avalos.Ar port
18918de8d7fSPeter Avaloson the local side, optionally bound to the specified
19018de8d7fSPeter Avalos.Ar bind_address .
19118de8d7fSPeter AvalosWhenever a connection is made to this port, the
19218de8d7fSPeter Avalosconnection is forwarded over the secure channel, and the application
19318de8d7fSPeter Avalosprotocol is then used to determine where to connect to from the
19418de8d7fSPeter Avalosremote machine.
19518de8d7fSPeter AvalosCurrently the SOCKS4 and SOCKS5 protocols are supported, and
19618de8d7fSPeter Avalos.Nm
19718de8d7fSPeter Avaloswill act as a SOCKS server.
19818de8d7fSPeter AvalosOnly root can forward privileged ports.
19918de8d7fSPeter AvalosDynamic port forwardings can also be specified in the configuration file.
20018de8d7fSPeter Avalos.Pp
201856ea928SPeter AvalosIPv6 addresses can be specified by enclosing the address in square brackets.
20218de8d7fSPeter AvalosOnly the superuser can forward privileged ports.
20318de8d7fSPeter AvalosBy default, the local port is bound in accordance with the
20418de8d7fSPeter Avalos.Cm GatewayPorts
20518de8d7fSPeter Avalossetting.
20618de8d7fSPeter AvalosHowever, an explicit
20718de8d7fSPeter Avalos.Ar bind_address
20818de8d7fSPeter Avalosmay be used to bind the connection to a specific address.
20918de8d7fSPeter AvalosThe
21018de8d7fSPeter Avalos.Ar bind_address
21118de8d7fSPeter Avalosof
21218de8d7fSPeter Avalos.Dq localhost
21318de8d7fSPeter Avalosindicates that the listening port be bound for local use only, while an
21418de8d7fSPeter Avalosempty address or
21518de8d7fSPeter Avalos.Sq *
21618de8d7fSPeter Avalosindicates that the port should be available from all interfaces.
217e9778795SPeter Avalos.Pp
21836e94dc5SPeter Avalos.It Fl E Ar log_file
21936e94dc5SPeter AvalosAppend debug logs to
22036e94dc5SPeter Avalos.Ar log_file
22136e94dc5SPeter Avalosinstead of standard error.
222e9778795SPeter Avalos.Pp
22318de8d7fSPeter Avalos.It Fl e Ar escape_char
22418de8d7fSPeter AvalosSets the escape character for sessions with a pty (default:
22518de8d7fSPeter Avalos.Ql ~ ) .
22618de8d7fSPeter AvalosThe escape character is only recognized at the beginning of a line.
22718de8d7fSPeter AvalosThe escape character followed by a dot
22818de8d7fSPeter Avalos.Pq Ql \&.
22918de8d7fSPeter Avaloscloses the connection;
23018de8d7fSPeter Avalosfollowed by control-Z suspends the connection;
23118de8d7fSPeter Avalosand followed by itself sends the escape character once.
23218de8d7fSPeter AvalosSetting the character to
23318de8d7fSPeter Avalos.Dq none
23418de8d7fSPeter Avalosdisables any escapes and makes the session fully transparent.
235e9778795SPeter Avalos.Pp
23618de8d7fSPeter Avalos.It Fl F Ar configfile
23718de8d7fSPeter AvalosSpecifies an alternative per-user configuration file.
23818de8d7fSPeter AvalosIf a configuration file is given on the command line,
23918de8d7fSPeter Avalosthe system-wide configuration file
24018de8d7fSPeter Avalos.Pq Pa /etc/ssh/ssh_config
24118de8d7fSPeter Avaloswill be ignored.
24218de8d7fSPeter AvalosThe default for the per-user configuration file is
24318de8d7fSPeter Avalos.Pa ~/.ssh/config .
2440cbfa66cSDaniel FojtIf set to
2450cbfa66cSDaniel Fojt.Dq none ,
2460cbfa66cSDaniel Fojtno configuration files will be read.
247e9778795SPeter Avalos.Pp
24818de8d7fSPeter Avalos.It Fl f
24918de8d7fSPeter AvalosRequests
25018de8d7fSPeter Avalos.Nm
25118de8d7fSPeter Avalosto go to background just before command execution.
25218de8d7fSPeter AvalosThis is useful if
25318de8d7fSPeter Avalos.Nm
25418de8d7fSPeter Avalosis going to ask for passwords or passphrases, but the user
25518de8d7fSPeter Avaloswants it in the background.
25618de8d7fSPeter AvalosThis implies
25718de8d7fSPeter Avalos.Fl n .
25818de8d7fSPeter AvalosThe recommended way to start X11 programs at a remote site is with
25918de8d7fSPeter Avalossomething like
26018de8d7fSPeter Avalos.Ic ssh -f host xterm .
26118de8d7fSPeter Avalos.Pp
26218de8d7fSPeter AvalosIf the
26318de8d7fSPeter Avalos.Cm ExitOnForwardFailure
26418de8d7fSPeter Avalosconfiguration option is set to
26518de8d7fSPeter Avalos.Dq yes ,
26618de8d7fSPeter Avalosthen a client started with
26718de8d7fSPeter Avalos.Fl f
26818de8d7fSPeter Avaloswill wait for all remote port forwards to be successfully established
26918de8d7fSPeter Avalosbefore placing itself in the background.
27050a69bb5SSascha WildnerRefer to the description of
27150a69bb5SSascha Wildner.Cm ForkAfterAuthentication
27250a69bb5SSascha Wildnerin
27350a69bb5SSascha Wildner.Xr ssh_config 5
27450a69bb5SSascha Wildnerfor details.
275e9778795SPeter Avalos.Pp
276e9778795SPeter Avalos.It Fl G
277e9778795SPeter AvalosCauses
278e9778795SPeter Avalos.Nm
279e9778795SPeter Avalosto print its configuration after evaluating
280e9778795SPeter Avalos.Cm Host
281e9778795SPeter Avalosand
282e9778795SPeter Avalos.Cm Match
283e9778795SPeter Avalosblocks and exit.
284e9778795SPeter Avalos.Pp
28518de8d7fSPeter Avalos.It Fl g
28618de8d7fSPeter AvalosAllows remote hosts to connect to local forwarded ports.
28736e94dc5SPeter AvalosIf used on a multiplexed connection, then this option must be specified
28836e94dc5SPeter Avaloson the master process.
289e9778795SPeter Avalos.Pp
290856ea928SPeter Avalos.It Fl I Ar pkcs11
291856ea928SPeter AvalosSpecify the PKCS#11 shared library
29218de8d7fSPeter Avalos.Nm
293664f4763Szrjshould use to communicate with a PKCS#11 token providing keys for user
294664f4763Szrjauthentication.
295e9778795SPeter Avalos.Pp
29618de8d7fSPeter Avalos.It Fl i Ar identity_file
29718de8d7fSPeter AvalosSelects a file from which the identity (private key) for
2989f304aafSPeter Avalospublic key authentication is read.
29950a69bb5SSascha WildnerYou can also specify a public key file to use the corresponding
30050a69bb5SSascha Wildnerprivate key that is loaded in
30150a69bb5SSascha Wildner.Xr ssh-agent 1
30250a69bb5SSascha Wildnerwhen the private key file is not present locally.
30318de8d7fSPeter AvalosThe default is
304ee116499SAntonio Huete Jimenez.Pa ~/.ssh/id_rsa ,
30536e94dc5SPeter Avalos.Pa ~/.ssh/id_ecdsa ,
3060cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ecdsa_sk ,
307*ba1276acSMatthew Dillon.Pa ~/.ssh/id_ed25519
30818de8d7fSPeter Avalosand
309*ba1276acSMatthew Dillon.Pa ~/.ssh/id_ed25519_sk .
31018de8d7fSPeter AvalosIdentity files may also be specified on
31118de8d7fSPeter Avalosa per-host basis in the configuration file.
31218de8d7fSPeter AvalosIt is possible to have multiple
31318de8d7fSPeter Avalos.Fl i
31418de8d7fSPeter Avalosoptions (and multiple identities specified in
31518de8d7fSPeter Avalosconfiguration files).
316e9778795SPeter AvalosIf no certificates have been explicitly specified by the
317e9778795SPeter Avalos.Cm CertificateFile
318e9778795SPeter Avalosdirective,
319856ea928SPeter Avalos.Nm
320856ea928SPeter Avaloswill also try to load certificate information from the filename obtained
321856ea928SPeter Avalosby appending
322856ea928SPeter Avalos.Pa -cert.pub
323856ea928SPeter Avalosto identity filenames.
324e9778795SPeter Avalos.Pp
325664f4763Szrj.It Fl J Ar destination
326*ba1276acSMatthew DillonConnect to the target host by first making an
327e9778795SPeter Avalos.Nm
328664f4763Szrjconnection to the jump host described by
329664f4763Szrj.Ar destination
330e9778795SPeter Avalosand then establishing a TCP forwarding to the ultimate destination from
331e9778795SPeter Avalosthere.
332e9778795SPeter AvalosMultiple jump hops may be specified separated by comma characters.
333*ba1276acSMatthew DillonIPv6 addresses can be specified by enclosing the address in square brackets.
334e9778795SPeter AvalosThis is a shortcut to specify a
335e9778795SPeter Avalos.Cm ProxyJump
336e9778795SPeter Avalosconfiguration directive.
337664f4763SzrjNote that configuration directives supplied on the command-line generally
338664f4763Szrjapply to the destination host and not any specified jump hosts.
339664f4763SzrjUse
340664f4763Szrj.Pa ~/.ssh/config
341664f4763Szrjto specify configuration for jump hosts.
342e9778795SPeter Avalos.Pp
34318de8d7fSPeter Avalos.It Fl K
34418de8d7fSPeter AvalosEnables GSSAPI-based authentication and forwarding (delegation) of GSSAPI
34518de8d7fSPeter Avaloscredentials to the server.
346e9778795SPeter Avalos.Pp
34718de8d7fSPeter Avalos.It Fl k
34818de8d7fSPeter AvalosDisables forwarding (delegation) of GSSAPI credentials to the server.
349e9778795SPeter Avalos.Pp
35018de8d7fSPeter Avalos.It Fl L Xo
35118de8d7fSPeter Avalos.Sm off
35218de8d7fSPeter Avalos.Oo Ar bind_address : Oc
35318de8d7fSPeter Avalos.Ar port : host : hostport
35418de8d7fSPeter Avalos.Sm on
35518de8d7fSPeter Avalos.Xc
356e9778795SPeter Avalos.It Fl L Xo
357e9778795SPeter Avalos.Sm off
358e9778795SPeter Avalos.Oo Ar bind_address : Oc
359e9778795SPeter Avalos.Ar port : remote_socket
360e9778795SPeter Avalos.Sm on
361e9778795SPeter Avalos.Xc
362e9778795SPeter Avalos.It Fl L Xo
363e9778795SPeter Avalos.Sm off
364e9778795SPeter Avalos.Ar local_socket : host : hostport
365e9778795SPeter Avalos.Sm on
366e9778795SPeter Avalos.Xc
367e9778795SPeter Avalos.It Fl L Xo
368e9778795SPeter Avalos.Sm off
369e9778795SPeter Avalos.Ar local_socket : remote_socket
370e9778795SPeter Avalos.Sm on
371e9778795SPeter Avalos.Xc
372e9778795SPeter AvalosSpecifies that connections to the given TCP port or Unix socket on the local
373e9778795SPeter Avalos(client) host are to be forwarded to the given host and port, or Unix socket,
374e9778795SPeter Avaloson the remote side.
375e9778795SPeter AvalosThis works by allocating a socket to listen to either a TCP
37618de8d7fSPeter Avalos.Ar port
37718de8d7fSPeter Avaloson the local side, optionally bound to the specified
378e9778795SPeter Avalos.Ar bind_address ,
379e9778795SPeter Avalosor to a Unix socket.
380e9778795SPeter AvalosWhenever a connection is made to the local port or socket, the
38118de8d7fSPeter Avalosconnection is forwarded over the secure channel, and a connection is
382e9778795SPeter Avalosmade to either
38318de8d7fSPeter Avalos.Ar host
38418de8d7fSPeter Avalosport
385e9778795SPeter Avalos.Ar hostport ,
386e9778795SPeter Avalosor the Unix socket
387e9778795SPeter Avalos.Ar remote_socket ,
38818de8d7fSPeter Avalosfrom the remote machine.
389e9778795SPeter Avalos.Pp
39018de8d7fSPeter AvalosPort forwardings can also be specified in the configuration file.
39118de8d7fSPeter AvalosOnly the superuser can forward privileged ports.
392e9778795SPeter AvalosIPv6 addresses can be specified by enclosing the address in square brackets.
393e9778795SPeter Avalos.Pp
39418de8d7fSPeter AvalosBy default, the local port is bound in accordance with the
39518de8d7fSPeter Avalos.Cm GatewayPorts
39618de8d7fSPeter Avalossetting.
39718de8d7fSPeter AvalosHowever, an explicit
39818de8d7fSPeter Avalos.Ar bind_address
39918de8d7fSPeter Avalosmay be used to bind the connection to a specific address.
40018de8d7fSPeter AvalosThe
40118de8d7fSPeter Avalos.Ar bind_address
40218de8d7fSPeter Avalosof
40318de8d7fSPeter Avalos.Dq localhost
40418de8d7fSPeter Avalosindicates that the listening port be bound for local use only, while an
40518de8d7fSPeter Avalosempty address or
40618de8d7fSPeter Avalos.Sq *
40718de8d7fSPeter Avalosindicates that the port should be available from all interfaces.
408e9778795SPeter Avalos.Pp
40918de8d7fSPeter Avalos.It Fl l Ar login_name
41018de8d7fSPeter AvalosSpecifies the user to log in as on the remote machine.
41118de8d7fSPeter AvalosThis also may be specified on a per-host basis in the configuration file.
412e9778795SPeter Avalos.Pp
41318de8d7fSPeter Avalos.It Fl M
41418de8d7fSPeter AvalosPlaces the
41518de8d7fSPeter Avalos.Nm
41618de8d7fSPeter Avalosclient into
41718de8d7fSPeter Avalos.Dq master
41818de8d7fSPeter Avalosmode for connection sharing.
41918de8d7fSPeter AvalosMultiple
42018de8d7fSPeter Avalos.Fl M
42118de8d7fSPeter Avalosoptions places
42218de8d7fSPeter Avalos.Nm
42318de8d7fSPeter Avalosinto
42418de8d7fSPeter Avalos.Dq master
425664f4763Szrjmode but with confirmation required using
426664f4763Szrj.Xr ssh-askpass 1
427664f4763Szrjbefore each operation that changes the multiplexing state
428664f4763Szrj(e.g. opening a new session).
42918de8d7fSPeter AvalosRefer to the description of
43018de8d7fSPeter Avalos.Cm ControlMaster
43118de8d7fSPeter Avalosin
43218de8d7fSPeter Avalos.Xr ssh_config 5
43318de8d7fSPeter Avalosfor details.
434e9778795SPeter Avalos.Pp
43518de8d7fSPeter Avalos.It Fl m Ar mac_spec
436e9778795SPeter AvalosA comma-separated list of MAC (message authentication code) algorithms,
437e9778795SPeter Avalosspecified in order of preference.
43818de8d7fSPeter AvalosSee the
43918de8d7fSPeter Avalos.Cm MACs
440ee116499SAntonio Huete Jimenezkeyword in
441ee116499SAntonio Huete Jimenez.Xr ssh_config 5
442ee116499SAntonio Huete Jimenezfor more information.
443e9778795SPeter Avalos.Pp
44418de8d7fSPeter Avalos.It Fl N
44518de8d7fSPeter AvalosDo not execute a remote command.
446e9778795SPeter AvalosThis is useful for just forwarding ports.
44750a69bb5SSascha WildnerRefer to the description of
44850a69bb5SSascha Wildner.Cm SessionType
44950a69bb5SSascha Wildnerin
45050a69bb5SSascha Wildner.Xr ssh_config 5
45150a69bb5SSascha Wildnerfor details.
452e9778795SPeter Avalos.Pp
45318de8d7fSPeter Avalos.It Fl n
45418de8d7fSPeter AvalosRedirects stdin from
45518de8d7fSPeter Avalos.Pa /dev/null
45618de8d7fSPeter Avalos(actually, prevents reading from stdin).
45718de8d7fSPeter AvalosThis must be used when
45818de8d7fSPeter Avalos.Nm
45918de8d7fSPeter Avalosis run in the background.
46018de8d7fSPeter AvalosA common trick is to use this to run X11 programs on a remote machine.
46118de8d7fSPeter AvalosFor example,
46218de8d7fSPeter Avalos.Ic ssh -n shadows.cs.hut.fi emacs &
46318de8d7fSPeter Avaloswill start an emacs on shadows.cs.hut.fi, and the X11
46418de8d7fSPeter Avalosconnection will be automatically forwarded over an encrypted channel.
46518de8d7fSPeter AvalosThe
46618de8d7fSPeter Avalos.Nm
46718de8d7fSPeter Avalosprogram will be put in the background.
46818de8d7fSPeter Avalos(This does not work if
46918de8d7fSPeter Avalos.Nm
47018de8d7fSPeter Avalosneeds to ask for a password or passphrase; see also the
47118de8d7fSPeter Avalos.Fl f
47218de8d7fSPeter Avalosoption.)
47350a69bb5SSascha WildnerRefer to the description of
47450a69bb5SSascha Wildner.Cm StdinNull
47550a69bb5SSascha Wildnerin
47650a69bb5SSascha Wildner.Xr ssh_config 5
47750a69bb5SSascha Wildnerfor details.
478e9778795SPeter Avalos.Pp
47918de8d7fSPeter Avalos.It Fl O Ar ctl_cmd
48018de8d7fSPeter AvalosControl an active connection multiplexing master process.
48118de8d7fSPeter AvalosWhen the
48218de8d7fSPeter Avalos.Fl O
48318de8d7fSPeter Avalosoption is specified, the
48418de8d7fSPeter Avalos.Ar ctl_cmd
48518de8d7fSPeter Avalosargument is interpreted and passed to the master process.
48618de8d7fSPeter AvalosValid commands are:
48718de8d7fSPeter Avalos.Dq check
488856ea928SPeter Avalos(check that the master process is running),
489856ea928SPeter Avalos.Dq forward
4901c188a7fSPeter Avalos(request forwardings without command execution),
49199e85e0dSPeter Avalos.Dq cancel
49299e85e0dSPeter Avalos(cancel forwardings),
49318de8d7fSPeter Avalos.Dq exit
4941c188a7fSPeter Avalos(request the master to exit), and
4951c188a7fSPeter Avalos.Dq stop
4961c188a7fSPeter Avalos(request the master to stop accepting further multiplexing requests).
497e9778795SPeter Avalos.Pp
49818de8d7fSPeter Avalos.It Fl o Ar option
49918de8d7fSPeter AvalosCan be used to give options in the format used in the configuration file.
50018de8d7fSPeter AvalosThis is useful for specifying options for which there is no separate
50118de8d7fSPeter Avaloscommand-line flag.
50218de8d7fSPeter AvalosFor full details of the options listed below, and their possible values, see
50318de8d7fSPeter Avalos.Xr ssh_config 5 .
50418de8d7fSPeter Avalos.Pp
50518de8d7fSPeter Avalos.Bl -tag -width Ds -offset indent -compact
506e9778795SPeter Avalos.It AddKeysToAgent
50718de8d7fSPeter Avalos.It AddressFamily
50818de8d7fSPeter Avalos.It BatchMode
50918de8d7fSPeter Avalos.It BindAddress
51036e94dc5SPeter Avalos.It CanonicalDomains
51136e94dc5SPeter Avalos.It CanonicalizeFallbackLocal
51236e94dc5SPeter Avalos.It CanonicalizeHostname
51336e94dc5SPeter Avalos.It CanonicalizeMaxDots
51436e94dc5SPeter Avalos.It CanonicalizePermittedCNAMEs
515664f4763Szrj.It CASignatureAlgorithms
516e9778795SPeter Avalos.It CertificateFile
51718de8d7fSPeter Avalos.It CheckHostIP
51818de8d7fSPeter Avalos.It Ciphers
51918de8d7fSPeter Avalos.It ClearAllForwardings
52018de8d7fSPeter Avalos.It Compression
52118de8d7fSPeter Avalos.It ConnectionAttempts
52218de8d7fSPeter Avalos.It ConnectTimeout
52318de8d7fSPeter Avalos.It ControlMaster
52418de8d7fSPeter Avalos.It ControlPath
52599e85e0dSPeter Avalos.It ControlPersist
52618de8d7fSPeter Avalos.It DynamicForward
527*ba1276acSMatthew Dillon.It EnableEscapeCommandline
52818de8d7fSPeter Avalos.It EscapeChar
52918de8d7fSPeter Avalos.It ExitOnForwardFailure
530e9778795SPeter Avalos.It FingerprintHash
53150a69bb5SSascha Wildner.It ForkAfterAuthentication
53218de8d7fSPeter Avalos.It ForwardAgent
53318de8d7fSPeter Avalos.It ForwardX11
53499e85e0dSPeter Avalos.It ForwardX11Timeout
53518de8d7fSPeter Avalos.It ForwardX11Trusted
53618de8d7fSPeter Avalos.It GatewayPorts
53718de8d7fSPeter Avalos.It GlobalKnownHostsFile
53818de8d7fSPeter Avalos.It GSSAPIAuthentication
53918de8d7fSPeter Avalos.It GSSAPIDelegateCredentials
54018de8d7fSPeter Avalos.It HashKnownHosts
54118de8d7fSPeter Avalos.It Host
54250a69bb5SSascha Wildner.It HostbasedAcceptedAlgorithms
54318de8d7fSPeter Avalos.It HostbasedAuthentication
54418de8d7fSPeter Avalos.It HostKeyAlgorithms
54518de8d7fSPeter Avalos.It HostKeyAlias
5460cbfa66cSDaniel Fojt.It Hostname
54718de8d7fSPeter Avalos.It IdentitiesOnly
548e9778795SPeter Avalos.It IdentityAgent
549e9778795SPeter Avalos.It IdentityFile
5509f304aafSPeter Avalos.It IPQoS
55199e85e0dSPeter Avalos.It KbdInteractiveAuthentication
55218de8d7fSPeter Avalos.It KbdInteractiveDevices
5539f304aafSPeter Avalos.It KexAlgorithms
55450a69bb5SSascha Wildner.It KnownHostsCommand
55518de8d7fSPeter Avalos.It LocalCommand
55618de8d7fSPeter Avalos.It LocalForward
55718de8d7fSPeter Avalos.It LogLevel
55818de8d7fSPeter Avalos.It MACs
55936e94dc5SPeter Avalos.It Match
56018de8d7fSPeter Avalos.It NoHostAuthenticationForLocalhost
56118de8d7fSPeter Avalos.It NumberOfPasswordPrompts
56218de8d7fSPeter Avalos.It PasswordAuthentication
56318de8d7fSPeter Avalos.It PermitLocalCommand
56450a69bb5SSascha Wildner.It PermitRemoteOpen
565856ea928SPeter Avalos.It PKCS11Provider
56618de8d7fSPeter Avalos.It Port
56718de8d7fSPeter Avalos.It PreferredAuthentications
56818de8d7fSPeter Avalos.It ProxyCommand
569e9778795SPeter Avalos.It ProxyJump
57036e94dc5SPeter Avalos.It ProxyUseFdpass
57150a69bb5SSascha Wildner.It PubkeyAcceptedAlgorithms
57218de8d7fSPeter Avalos.It PubkeyAuthentication
57318de8d7fSPeter Avalos.It RekeyLimit
574ce74bacaSMatthew Dillon.It RemoteCommand
57518de8d7fSPeter Avalos.It RemoteForward
5761c188a7fSPeter Avalos.It RequestTTY
577ee116499SAntonio Huete Jimenez.It RequiredRSASize
57818de8d7fSPeter Avalos.It SendEnv
57918de8d7fSPeter Avalos.It ServerAliveInterval
58018de8d7fSPeter Avalos.It ServerAliveCountMax
58150a69bb5SSascha Wildner.It SessionType
582664f4763Szrj.It SetEnv
58350a69bb5SSascha Wildner.It StdinNull
58436e94dc5SPeter Avalos.It StreamLocalBindMask
58536e94dc5SPeter Avalos.It StreamLocalBindUnlink
58618de8d7fSPeter Avalos.It StrictHostKeyChecking
58718de8d7fSPeter Avalos.It TCPKeepAlive
58818de8d7fSPeter Avalos.It Tunnel
58918de8d7fSPeter Avalos.It TunnelDevice
590e9778795SPeter Avalos.It UpdateHostKeys
59118de8d7fSPeter Avalos.It User
59218de8d7fSPeter Avalos.It UserKnownHostsFile
59318de8d7fSPeter Avalos.It VerifyHostKeyDNS
59418de8d7fSPeter Avalos.It VisualHostKey
59518de8d7fSPeter Avalos.It XAuthLocation
59618de8d7fSPeter Avalos.El
597e9778795SPeter Avalos.Pp
598*ba1276acSMatthew Dillon.It Fl P Ar tag
599*ba1276acSMatthew DillonSpecify a tag name that may be used to select configuration in
600*ba1276acSMatthew Dillon.Xr ssh_config 5 .
601*ba1276acSMatthew DillonRefer to the
602*ba1276acSMatthew Dillon.Cm Tag
603*ba1276acSMatthew Dillonand
604*ba1276acSMatthew Dillon.Cm Match
605*ba1276acSMatthew Dillonkeywords in
606*ba1276acSMatthew Dillon.Xr ssh_config 5
607*ba1276acSMatthew Dillonfor more information.
60818de8d7fSPeter Avalos.It Fl p Ar port
60918de8d7fSPeter AvalosPort to connect to on the remote host.
61018de8d7fSPeter AvalosThis can be specified on a
61118de8d7fSPeter Avalosper-host basis in the configuration file.
612e9778795SPeter Avalos.Pp
613e9778795SPeter Avalos.It Fl Q Ar query_option
61450a69bb5SSascha WildnerQueries for the algorithms supported by one of the following features:
61536e94dc5SPeter Avalos.Ar cipher
61636e94dc5SPeter Avalos(supported symmetric ciphers),
61736e94dc5SPeter Avalos.Ar cipher-auth
61836e94dc5SPeter Avalos(supported symmetric ciphers that support authenticated encryption),
619664f4763Szrj.Ar help
620664f4763Szrj(supported query terms for use with the
621664f4763Szrj.Fl Q
622664f4763Szrjflag),
62336e94dc5SPeter Avalos.Ar mac
62436e94dc5SPeter Avalos(supported message integrity codes),
62536e94dc5SPeter Avalos.Ar kex
62636e94dc5SPeter Avalos(key exchange algorithms),
62736e94dc5SPeter Avalos.Ar key
628e9778795SPeter Avalos(key types),
629*ba1276acSMatthew Dillon.Ar key-ca-sign
630*ba1276acSMatthew Dillon(valid CA signature algorithms for certificates),
631e9778795SPeter Avalos.Ar key-cert
632e9778795SPeter Avalos(certificate key types),
633e9778795SPeter Avalos.Ar key-plain
634664f4763Szrj(non-certificate key types),
6350cbfa66cSDaniel Fojt.Ar key-sig
6360cbfa66cSDaniel Fojt(all key types and signature algorithms),
637e9778795SPeter Avalos.Ar protocol-version
638664f4763Szrj(supported SSH protocol versions), and
639664f4763Szrj.Ar sig
640664f4763Szrj(supported signature algorithms).
6410cbfa66cSDaniel FojtAlternatively, any keyword from
6420cbfa66cSDaniel Fojt.Xr ssh_config 5
6430cbfa66cSDaniel Fojtor
6440cbfa66cSDaniel Fojt.Xr sshd_config 5
6450cbfa66cSDaniel Fojtthat takes an algorithm list may be used as an alias for the corresponding
6460cbfa66cSDaniel Fojtquery_option.
647e9778795SPeter Avalos.Pp
64818de8d7fSPeter Avalos.It Fl q
64918de8d7fSPeter AvalosQuiet mode.
65018de8d7fSPeter AvalosCauses most warning and diagnostic messages to be suppressed.
651e9778795SPeter Avalos.Pp
65218de8d7fSPeter Avalos.It Fl R Xo
65318de8d7fSPeter Avalos.Sm off
65418de8d7fSPeter Avalos.Oo Ar bind_address : Oc
65518de8d7fSPeter Avalos.Ar port : host : hostport
65618de8d7fSPeter Avalos.Sm on
65718de8d7fSPeter Avalos.Xc
658e9778795SPeter Avalos.It Fl R Xo
659e9778795SPeter Avalos.Sm off
660e9778795SPeter Avalos.Oo Ar bind_address : Oc
661e9778795SPeter Avalos.Ar port : local_socket
662e9778795SPeter Avalos.Sm on
663e9778795SPeter Avalos.Xc
664e9778795SPeter Avalos.It Fl R Xo
665e9778795SPeter Avalos.Sm off
666e9778795SPeter Avalos.Ar remote_socket : host : hostport
667e9778795SPeter Avalos.Sm on
668e9778795SPeter Avalos.Xc
669e9778795SPeter Avalos.It Fl R Xo
670e9778795SPeter Avalos.Sm off
671e9778795SPeter Avalos.Ar remote_socket : local_socket
672e9778795SPeter Avalos.Sm on
673e9778795SPeter Avalos.Xc
674ce74bacaSMatthew Dillon.It Fl R Xo
675ce74bacaSMatthew Dillon.Sm off
676ce74bacaSMatthew Dillon.Oo Ar bind_address : Oc
677ce74bacaSMatthew Dillon.Ar port
678ce74bacaSMatthew Dillon.Sm on
679ce74bacaSMatthew Dillon.Xc
680e9778795SPeter AvalosSpecifies that connections to the given TCP port or Unix socket on the remote
681ce74bacaSMatthew Dillon(server) host are to be forwarded to the local side.
682ce74bacaSMatthew Dillon.Pp
683e9778795SPeter AvalosThis works by allocating a socket to listen to either a TCP
68418de8d7fSPeter Avalos.Ar port
685e9778795SPeter Avalosor to a Unix socket on the remote side.
686e9778795SPeter AvalosWhenever a connection is made to this port or Unix socket, the
687e9778795SPeter Avalosconnection is forwarded over the secure channel, and a connection
688ce74bacaSMatthew Dillonis made from the local machine to either an explicit destination specified by
68918de8d7fSPeter Avalos.Ar host
69018de8d7fSPeter Avalosport
691e9778795SPeter Avalos.Ar hostport ,
692e9778795SPeter Avalosor
693e9778795SPeter Avalos.Ar local_socket ,
694ce74bacaSMatthew Dillonor, if no explicit destination was specified,
695ce74bacaSMatthew Dillon.Nm
696ce74bacaSMatthew Dillonwill act as a SOCKS 4/5 proxy and forward connections to the destinations
697ce74bacaSMatthew Dillonrequested by the remote SOCKS client.
69818de8d7fSPeter Avalos.Pp
69918de8d7fSPeter AvalosPort forwardings can also be specified in the configuration file.
70018de8d7fSPeter AvalosPrivileged ports can be forwarded only when
70118de8d7fSPeter Avaloslogging in as root on the remote machine.
70299e85e0dSPeter AvalosIPv6 addresses can be specified by enclosing the address in square brackets.
70318de8d7fSPeter Avalos.Pp
704e9778795SPeter AvalosBy default, TCP listening sockets on the server will be bound to the loopback
70518de8d7fSPeter Avalosinterface only.
706cb5eb4f1SPeter AvalosThis may be overridden by specifying a
70718de8d7fSPeter Avalos.Ar bind_address .
70818de8d7fSPeter AvalosAn empty
70918de8d7fSPeter Avalos.Ar bind_address ,
71018de8d7fSPeter Avalosor the address
71118de8d7fSPeter Avalos.Ql * ,
71218de8d7fSPeter Avalosindicates that the remote socket should listen on all interfaces.
71318de8d7fSPeter AvalosSpecifying a remote
71418de8d7fSPeter Avalos.Ar bind_address
71518de8d7fSPeter Avaloswill only succeed if the server's
71618de8d7fSPeter Avalos.Cm GatewayPorts
71718de8d7fSPeter Avalosoption is enabled (see
71818de8d7fSPeter Avalos.Xr sshd_config 5 ) .
719cb5eb4f1SPeter Avalos.Pp
720cb5eb4f1SPeter AvalosIf the
721cb5eb4f1SPeter Avalos.Ar port
722cb5eb4f1SPeter Avalosargument is
723cb5eb4f1SPeter Avalos.Ql 0 ,
724cb5eb4f1SPeter Avalosthe listen port will be dynamically allocated on the server and reported
725cb5eb4f1SPeter Avalosto the client at run time.
726856ea928SPeter AvalosWhen used together with
727ee116499SAntonio Huete Jimenez.Ic -O forward ,
728856ea928SPeter Avalosthe allocated port will be printed to the standard output.
729e9778795SPeter Avalos.Pp
73018de8d7fSPeter Avalos.It Fl S Ar ctl_path
731856ea928SPeter AvalosSpecifies the location of a control socket for connection sharing,
732856ea928SPeter Avalosor the string
733856ea928SPeter Avalos.Dq none
734856ea928SPeter Avalosto disable connection sharing.
73518de8d7fSPeter AvalosRefer to the description of
73618de8d7fSPeter Avalos.Cm ControlPath
73718de8d7fSPeter Avalosand
73818de8d7fSPeter Avalos.Cm ControlMaster
73918de8d7fSPeter Avalosin
74018de8d7fSPeter Avalos.Xr ssh_config 5
74118de8d7fSPeter Avalosfor details.
742e9778795SPeter Avalos.Pp
74318de8d7fSPeter Avalos.It Fl s
74418de8d7fSPeter AvalosMay be used to request invocation of a subsystem on the remote system.
745e9778795SPeter AvalosSubsystems facilitate the use of SSH
746e9778795SPeter Avalosas a secure transport for other applications (e.g.\&
74718de8d7fSPeter Avalos.Xr sftp 1 ) .
74818de8d7fSPeter AvalosThe subsystem is specified as the remote command.
74950a69bb5SSascha WildnerRefer to the description of
75050a69bb5SSascha Wildner.Cm SessionType
75150a69bb5SSascha Wildnerin
75250a69bb5SSascha Wildner.Xr ssh_config 5
75350a69bb5SSascha Wildnerfor details.
754e9778795SPeter Avalos.Pp
75518de8d7fSPeter Avalos.It Fl T
756e9778795SPeter AvalosDisable pseudo-terminal allocation.
757e9778795SPeter Avalos.Pp
75818de8d7fSPeter Avalos.It Fl t
759e9778795SPeter AvalosForce pseudo-terminal allocation.
76018de8d7fSPeter AvalosThis can be used to execute arbitrary
76118de8d7fSPeter Avalosscreen-based programs on a remote machine, which can be very useful,
76218de8d7fSPeter Avalose.g. when implementing menu services.
76318de8d7fSPeter AvalosMultiple
76418de8d7fSPeter Avalos.Fl t
76518de8d7fSPeter Avalosoptions force tty allocation, even if
76618de8d7fSPeter Avalos.Nm
76718de8d7fSPeter Avaloshas no local tty.
768e9778795SPeter Avalos.Pp
76918de8d7fSPeter Avalos.It Fl V
77018de8d7fSPeter AvalosDisplay the version number and exit.
771e9778795SPeter Avalos.Pp
77218de8d7fSPeter Avalos.It Fl v
77318de8d7fSPeter AvalosVerbose mode.
77418de8d7fSPeter AvalosCauses
77518de8d7fSPeter Avalos.Nm
77618de8d7fSPeter Avalosto print debugging messages about its progress.
77718de8d7fSPeter AvalosThis is helpful in
77818de8d7fSPeter Avalosdebugging connection, authentication, and configuration problems.
77918de8d7fSPeter AvalosMultiple
78018de8d7fSPeter Avalos.Fl v
78118de8d7fSPeter Avalosoptions increase the verbosity.
78218de8d7fSPeter AvalosThe maximum is 3.
783e9778795SPeter Avalos.Pp
784856ea928SPeter Avalos.It Fl W Ar host : Ns Ar port
785856ea928SPeter AvalosRequests that standard input and output on the client be forwarded to
786856ea928SPeter Avalos.Ar host
787856ea928SPeter Avaloson
788856ea928SPeter Avalos.Ar port
789856ea928SPeter Avalosover the secure channel.
790856ea928SPeter AvalosImplies
791856ea928SPeter Avalos.Fl N ,
792856ea928SPeter Avalos.Fl T ,
793856ea928SPeter Avalos.Cm ExitOnForwardFailure
794856ea928SPeter Avalosand
795e9778795SPeter Avalos.Cm ClearAllForwardings ,
796e9778795SPeter Avalosthough these can be overridden in the configuration file or using
797e9778795SPeter Avalos.Fl o
798e9778795SPeter Avaloscommand line options.
799e9778795SPeter Avalos.Pp
80018de8d7fSPeter Avalos.It Fl w Xo
80118de8d7fSPeter Avalos.Ar local_tun Ns Op : Ns Ar remote_tun
80218de8d7fSPeter Avalos.Xc
80318de8d7fSPeter AvalosRequests
80418de8d7fSPeter Avalostunnel
80518de8d7fSPeter Avalosdevice forwarding with the specified
80618de8d7fSPeter Avalos.Xr tun 4
80718de8d7fSPeter Avalosdevices between the client
80818de8d7fSPeter Avalos.Pq Ar local_tun
80918de8d7fSPeter Avalosand the server
81018de8d7fSPeter Avalos.Pq Ar remote_tun .
81118de8d7fSPeter Avalos.Pp
81218de8d7fSPeter AvalosThe devices may be specified by numerical ID or the keyword
81318de8d7fSPeter Avalos.Dq any ,
81418de8d7fSPeter Avaloswhich uses the next available tunnel device.
81518de8d7fSPeter AvalosIf
81618de8d7fSPeter Avalos.Ar remote_tun
81718de8d7fSPeter Avalosis not specified, it defaults to
81818de8d7fSPeter Avalos.Dq any .
81918de8d7fSPeter AvalosSee also the
82018de8d7fSPeter Avalos.Cm Tunnel
82118de8d7fSPeter Avalosand
82218de8d7fSPeter Avalos.Cm TunnelDevice
82318de8d7fSPeter Avalosdirectives in
82418de8d7fSPeter Avalos.Xr ssh_config 5 .
825664f4763Szrj.Pp
82618de8d7fSPeter AvalosIf the
82718de8d7fSPeter Avalos.Cm Tunnel
828664f4763Szrjdirective is unset, it will be set to the default tunnel mode, which is
82918de8d7fSPeter Avalos.Dq point-to-point .
830664f4763SzrjIf a different
831664f4763Szrj.Cm Tunnel
832664f4763Szrjforwarding mode it desired, then it should be specified before
833664f4763Szrj.Fl w .
834e9778795SPeter Avalos.Pp
83518de8d7fSPeter Avalos.It Fl X
83618de8d7fSPeter AvalosEnables X11 forwarding.
83718de8d7fSPeter AvalosThis can also be specified on a per-host basis in a configuration file.
83818de8d7fSPeter Avalos.Pp
83918de8d7fSPeter AvalosX11 forwarding should be enabled with caution.
84018de8d7fSPeter AvalosUsers with the ability to bypass file permissions on the remote host
84118de8d7fSPeter Avalos(for the user's X authorization database)
84218de8d7fSPeter Avaloscan access the local X11 display through the forwarded connection.
84318de8d7fSPeter AvalosAn attacker may then be able to perform activities such as keystroke monitoring.
84418de8d7fSPeter Avalos.Pp
84518de8d7fSPeter AvalosFor this reason, X11 forwarding is subjected to X11 SECURITY extension
84618de8d7fSPeter Avalosrestrictions by default.
847ee116499SAntonio Huete JimenezRefer to the
84818de8d7fSPeter Avalos.Nm
84918de8d7fSPeter Avalos.Fl Y
85018de8d7fSPeter Avalosoption and the
85118de8d7fSPeter Avalos.Cm ForwardX11Trusted
85218de8d7fSPeter Avalosdirective in
85318de8d7fSPeter Avalos.Xr ssh_config 5
85418de8d7fSPeter Avalosfor more information.
855e9778795SPeter Avalos.Pp
85618de8d7fSPeter Avalos.It Fl x
85718de8d7fSPeter AvalosDisables X11 forwarding.
858e9778795SPeter Avalos.Pp
85918de8d7fSPeter Avalos.It Fl Y
86018de8d7fSPeter AvalosEnables trusted X11 forwarding.
86118de8d7fSPeter AvalosTrusted X11 forwardings are not subjected to the X11 SECURITY extension
86218de8d7fSPeter Avaloscontrols.
863e9778795SPeter Avalos.Pp
864cb5eb4f1SPeter Avalos.It Fl y
865cb5eb4f1SPeter AvalosSend log information using the
866cb5eb4f1SPeter Avalos.Xr syslog 3
867cb5eb4f1SPeter Avalossystem module.
868cb5eb4f1SPeter AvalosBy default this information is sent to stderr.
86918de8d7fSPeter Avalos.El
87018de8d7fSPeter Avalos.Pp
87118de8d7fSPeter Avalos.Nm
87218de8d7fSPeter Avalosmay additionally obtain configuration data from
87318de8d7fSPeter Avalosa per-user configuration file and a system-wide configuration file.
87418de8d7fSPeter AvalosThe file format and configuration options are described in
87518de8d7fSPeter Avalos.Xr ssh_config 5 .
87618de8d7fSPeter Avalos.Sh AUTHENTICATION
877ce74bacaSMatthew DillonThe OpenSSH SSH client supports SSH protocol 2.
87818de8d7fSPeter Avalos.Pp
87918de8d7fSPeter AvalosThe methods available for authentication are:
88018de8d7fSPeter AvalosGSSAPI-based authentication,
88118de8d7fSPeter Avaloshost-based authentication,
88218de8d7fSPeter Avalospublic key authentication,
88350a69bb5SSascha Wildnerkeyboard-interactive authentication,
88418de8d7fSPeter Avalosand password authentication.
88518de8d7fSPeter AvalosAuthentication methods are tried in the order specified above,
886e9778795SPeter Avalosthough
887e9778795SPeter Avalos.Cm PreferredAuthentications
888e9778795SPeter Avaloscan be used to change the default order.
88918de8d7fSPeter Avalos.Pp
89018de8d7fSPeter AvalosHost-based authentication works as follows:
89118de8d7fSPeter AvalosIf the machine the user logs in from is listed in
89218de8d7fSPeter Avalos.Pa /etc/hosts.equiv
89318de8d7fSPeter Avalosor
89418de8d7fSPeter Avalos.Pa /etc/shosts.equiv
8950cbfa66cSDaniel Fojton the remote machine, the user is non-root and the user names are
89618de8d7fSPeter Avalosthe same on both sides, or if the files
89718de8d7fSPeter Avalos.Pa ~/.rhosts
89818de8d7fSPeter Avalosor
89918de8d7fSPeter Avalos.Pa ~/.shosts
90018de8d7fSPeter Avalosexist in the user's home directory on the
90118de8d7fSPeter Avalosremote machine and contain a line containing the name of the client
90218de8d7fSPeter Avalosmachine and the name of the user on that machine, the user is
90318de8d7fSPeter Avalosconsidered for login.
90418de8d7fSPeter AvalosAdditionally, the server
90518de8d7fSPeter Avalos.Em must
90618de8d7fSPeter Avalosbe able to verify the client's
90718de8d7fSPeter Avaloshost key (see the description of
90818de8d7fSPeter Avalos.Pa /etc/ssh/ssh_known_hosts
90918de8d7fSPeter Avalosand
91018de8d7fSPeter Avalos.Pa ~/.ssh/known_hosts ,
91118de8d7fSPeter Avalosbelow)
91218de8d7fSPeter Avalosfor login to be permitted.
91318de8d7fSPeter AvalosThis authentication method closes security holes due to IP
91418de8d7fSPeter Avalosspoofing, DNS spoofing, and routing spoofing.
91518de8d7fSPeter Avalos[Note to the administrator:
91618de8d7fSPeter Avalos.Pa /etc/hosts.equiv ,
91718de8d7fSPeter Avalos.Pa ~/.rhosts ,
91818de8d7fSPeter Avalosand the rlogin/rsh protocol in general, are inherently insecure and should be
91918de8d7fSPeter Avalosdisabled if security is desired.]
92018de8d7fSPeter Avalos.Pp
92118de8d7fSPeter AvalosPublic key authentication works as follows:
92218de8d7fSPeter AvalosThe scheme is based on public-key cryptography,
92318de8d7fSPeter Avalosusing cryptosystems
92418de8d7fSPeter Avaloswhere encryption and decryption are done using separate keys,
92518de8d7fSPeter Avalosand it is unfeasible to derive the decryption key from the encryption key.
92618de8d7fSPeter AvalosThe idea is that each user creates a public/private
92718de8d7fSPeter Avaloskey pair for authentication purposes.
92818de8d7fSPeter AvalosThe server knows the public key, and only the user knows the private key.
92918de8d7fSPeter Avalos.Nm
93018de8d7fSPeter Avalosimplements public key authentication protocol automatically,
931*ba1276acSMatthew Dillonusing one of the ECDSA, Ed25519 or RSA algorithms.
93218de8d7fSPeter Avalos.Pp
93318de8d7fSPeter AvalosThe file
93418de8d7fSPeter Avalos.Pa ~/.ssh/authorized_keys
93518de8d7fSPeter Avaloslists the public keys that are permitted for logging in.
93618de8d7fSPeter AvalosWhen the user logs in, the
93718de8d7fSPeter Avalos.Nm
93818de8d7fSPeter Avalosprogram tells the server which key pair it would like to use for
93918de8d7fSPeter Avalosauthentication.
94018de8d7fSPeter AvalosThe client proves that it has access to the private key
94118de8d7fSPeter Avalosand the server checks that the corresponding public key
94218de8d7fSPeter Avalosis authorized to accept the account.
94318de8d7fSPeter Avalos.Pp
944ce74bacaSMatthew DillonThe server may inform the client of errors that prevented public key
945ce74bacaSMatthew Dillonauthentication from succeeding after authentication completes using a
946ce74bacaSMatthew Dillondifferent method.
947ce74bacaSMatthew DillonThese may be viewed by increasing the
948ce74bacaSMatthew Dillon.Cm LogLevel
949ce74bacaSMatthew Dillonto
950ce74bacaSMatthew Dillon.Cm DEBUG
951ce74bacaSMatthew Dillonor higher (e.g. by using the
952ce74bacaSMatthew Dillon.Fl v
953ce74bacaSMatthew Dillonflag).
954ce74bacaSMatthew Dillon.Pp
95550a69bb5SSascha WildnerThe user creates their key pair by running
95618de8d7fSPeter Avalos.Xr ssh-keygen 1 .
95718de8d7fSPeter AvalosThis stores the private key in
9589f304aafSPeter Avalos.Pa ~/.ssh/id_ecdsa
959e9778795SPeter Avalos(ECDSA),
9600cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ecdsa_sk
9610cbfa66cSDaniel Fojt(authenticator-hosted ECDSA),
96236e94dc5SPeter Avalos.Pa ~/.ssh/id_ed25519
963e9778795SPeter Avalos(Ed25519),
9640cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ed25519_sk
9650cbfa66cSDaniel Fojt(authenticator-hosted Ed25519),
96618de8d7fSPeter Avalosor
96718de8d7fSPeter Avalos.Pa ~/.ssh/id_rsa
968e9778795SPeter Avalos(RSA)
96918de8d7fSPeter Avalosand stores the public key in
9709f304aafSPeter Avalos.Pa ~/.ssh/id_ecdsa.pub
971e9778795SPeter Avalos(ECDSA),
9720cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ecdsa_sk.pub
9730cbfa66cSDaniel Fojt(authenticator-hosted ECDSA),
97436e94dc5SPeter Avalos.Pa ~/.ssh/id_ed25519.pub
975e9778795SPeter Avalos(Ed25519),
9760cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ed25519_sk.pub
9770cbfa66cSDaniel Fojt(authenticator-hosted Ed25519),
97818de8d7fSPeter Avalosor
97918de8d7fSPeter Avalos.Pa ~/.ssh/id_rsa.pub
980e9778795SPeter Avalos(RSA)
98118de8d7fSPeter Avalosin the user's home directory.
98218de8d7fSPeter AvalosThe user should then copy the public key
98318de8d7fSPeter Avalosto
98418de8d7fSPeter Avalos.Pa ~/.ssh/authorized_keys
98550a69bb5SSascha Wildnerin their home directory on the remote machine.
98618de8d7fSPeter AvalosThe
98718de8d7fSPeter Avalos.Pa authorized_keys
98818de8d7fSPeter Avalosfile corresponds to the conventional
98918de8d7fSPeter Avalos.Pa ~/.rhosts
99018de8d7fSPeter Avalosfile, and has one key
99118de8d7fSPeter Avalosper line, though the lines can be very long.
99218de8d7fSPeter AvalosAfter this, the user can log in without giving the password.
99318de8d7fSPeter Avalos.Pp
994856ea928SPeter AvalosA variation on public key authentication
995856ea928SPeter Avalosis available in the form of certificate authentication:
996856ea928SPeter Avalosinstead of a set of public/private keys,
997856ea928SPeter Avalossigned certificates are used.
998856ea928SPeter AvalosThis has the advantage that a single trusted certification authority
999856ea928SPeter Avaloscan be used in place of many public/private keys.
100036e94dc5SPeter AvalosSee the CERTIFICATES section of
1001856ea928SPeter Avalos.Xr ssh-keygen 1
1002856ea928SPeter Avalosfor more information.
1003856ea928SPeter Avalos.Pp
1004856ea928SPeter AvalosThe most convenient way to use public key or certificate authentication
1005856ea928SPeter Avalosmay be with an authentication agent.
100618de8d7fSPeter AvalosSee
100718de8d7fSPeter Avalos.Xr ssh-agent 1
1008e9778795SPeter Avalosand (optionally) the
1009e9778795SPeter Avalos.Cm AddKeysToAgent
1010e9778795SPeter Avalosdirective in
1011e9778795SPeter Avalos.Xr ssh_config 5
101218de8d7fSPeter Avalosfor more information.
101318de8d7fSPeter Avalos.Pp
101450a69bb5SSascha WildnerKeyboard-interactive authentication works as follows:
101518de8d7fSPeter AvalosThe server sends an arbitrary
101618de8d7fSPeter Avalos.Qq challenge
101750a69bb5SSascha Wildnertext and prompts for a response, possibly multiple times.
101850a69bb5SSascha WildnerExamples of keyboard-interactive authentication include
101936e94dc5SPeter Avalos.Bx
102036e94dc5SPeter AvalosAuthentication (see
102118de8d7fSPeter Avalos.Xr login.conf 5 )
102236e94dc5SPeter Avalosand PAM (some
102336e94dc5SPeter Avalos.Pf non- Ox
102436e94dc5SPeter Avalossystems).
102518de8d7fSPeter Avalos.Pp
102618de8d7fSPeter AvalosFinally, if other authentication methods fail,
102718de8d7fSPeter Avalos.Nm
102818de8d7fSPeter Avalosprompts the user for a password.
102918de8d7fSPeter AvalosThe password is sent to the remote
103018de8d7fSPeter Avaloshost for checking; however, since all communications are encrypted,
103118de8d7fSPeter Avalosthe password cannot be seen by someone listening on the network.
103218de8d7fSPeter Avalos.Pp
103318de8d7fSPeter Avalos.Nm
103418de8d7fSPeter Avalosautomatically maintains and checks a database containing
103518de8d7fSPeter Avalosidentification for all hosts it has ever been used with.
103618de8d7fSPeter AvalosHost keys are stored in
103718de8d7fSPeter Avalos.Pa ~/.ssh/known_hosts
103818de8d7fSPeter Avalosin the user's home directory.
103918de8d7fSPeter AvalosAdditionally, the file
104018de8d7fSPeter Avalos.Pa /etc/ssh/ssh_known_hosts
104118de8d7fSPeter Avalosis automatically checked for known hosts.
104218de8d7fSPeter AvalosAny new hosts are automatically added to the user's file.
104318de8d7fSPeter AvalosIf a host's identification ever changes,
104418de8d7fSPeter Avalos.Nm
104518de8d7fSPeter Avaloswarns about this and disables password authentication to prevent
104618de8d7fSPeter Avalosserver spoofing or man-in-the-middle attacks,
104718de8d7fSPeter Avaloswhich could otherwise be used to circumvent the encryption.
104818de8d7fSPeter AvalosThe
104918de8d7fSPeter Avalos.Cm StrictHostKeyChecking
105018de8d7fSPeter Avalosoption can be used to control logins to machines whose
105118de8d7fSPeter Avaloshost key is not known or has changed.
105218de8d7fSPeter Avalos.Pp
105318de8d7fSPeter AvalosWhen the user's identity has been accepted by the server, the server
1054e9778795SPeter Avaloseither executes the given command in a non-interactive session or,
1055e9778795SPeter Avalosif no command has been specified, logs into the machine and gives
1056e9778795SPeter Avalosthe user a normal shell as an interactive session.
105718de8d7fSPeter AvalosAll communication with
105818de8d7fSPeter Avalosthe remote command or shell will be automatically encrypted.
105918de8d7fSPeter Avalos.Pp
1060ee116499SAntonio Huete JimenezIf an interactive session is requested,
1061e9778795SPeter Avalos.Nm
1062e9778795SPeter Avalosby default will only request a pseudo-terminal (pty) for interactive
1063e9778795SPeter Avalossessions when the client has one.
1064e9778795SPeter AvalosThe flags
1065e9778795SPeter Avalos.Fl T
1066e9778795SPeter Avalosand
1067e9778795SPeter Avalos.Fl t
1068e9778795SPeter Avaloscan be used to override this behaviour.
1069e9778795SPeter Avalos.Pp
1070ee116499SAntonio Huete JimenezIf a pseudo-terminal has been allocated, the
107118de8d7fSPeter Avalosuser may use the escape characters noted below.
107218de8d7fSPeter Avalos.Pp
1073e9778795SPeter AvalosIf no pseudo-terminal has been allocated,
107418de8d7fSPeter Avalosthe session is transparent and can be used to reliably transfer binary data.
107518de8d7fSPeter AvalosOn most systems, setting the escape character to
107618de8d7fSPeter Avalos.Dq none
107718de8d7fSPeter Avaloswill also make the session transparent even if a tty is used.
107818de8d7fSPeter Avalos.Pp
107918de8d7fSPeter AvalosThe session terminates when the command or shell on the remote
108018de8d7fSPeter Avalosmachine exits and all X11 and TCP connections have been closed.
108118de8d7fSPeter Avalos.Sh ESCAPE CHARACTERS
108218de8d7fSPeter AvalosWhen a pseudo-terminal has been requested,
108318de8d7fSPeter Avalos.Nm
108418de8d7fSPeter Avalossupports a number of functions through the use of an escape character.
108518de8d7fSPeter Avalos.Pp
108618de8d7fSPeter AvalosA single tilde character can be sent as
108718de8d7fSPeter Avalos.Ic ~~
108818de8d7fSPeter Avalosor by following the tilde by a character other than those described below.
108918de8d7fSPeter AvalosThe escape character must always follow a newline to be interpreted as
109018de8d7fSPeter Avalosspecial.
109118de8d7fSPeter AvalosThe escape character can be changed in configuration files using the
109218de8d7fSPeter Avalos.Cm EscapeChar
109318de8d7fSPeter Avalosconfiguration directive or on the command line by the
109418de8d7fSPeter Avalos.Fl e
109518de8d7fSPeter Avalosoption.
109618de8d7fSPeter Avalos.Pp
109718de8d7fSPeter AvalosThe supported escapes (assuming the default
109818de8d7fSPeter Avalos.Ql ~ )
109918de8d7fSPeter Avalosare:
110018de8d7fSPeter Avalos.Bl -tag -width Ds
110118de8d7fSPeter Avalos.It Cm ~.
110218de8d7fSPeter AvalosDisconnect.
110318de8d7fSPeter Avalos.It Cm ~^Z
110418de8d7fSPeter AvalosBackground
110518de8d7fSPeter Avalos.Nm .
110618de8d7fSPeter Avalos.It Cm ~#
110718de8d7fSPeter AvalosList forwarded connections.
110818de8d7fSPeter Avalos.It Cm ~&
110918de8d7fSPeter AvalosBackground
111018de8d7fSPeter Avalos.Nm
111118de8d7fSPeter Avalosat logout when waiting for forwarded connection / X11 sessions to terminate.
111218de8d7fSPeter Avalos.It Cm ~?
111318de8d7fSPeter AvalosDisplay a list of escape characters.
111418de8d7fSPeter Avalos.It Cm ~B
111518de8d7fSPeter AvalosSend a BREAK to the remote system
1116e9778795SPeter Avalos(only useful if the peer supports it).
111718de8d7fSPeter Avalos.It Cm ~C
111818de8d7fSPeter AvalosOpen command line.
111918de8d7fSPeter AvalosCurrently this allows the addition of port forwardings using the
1120cb5eb4f1SPeter Avalos.Fl L ,
112118de8d7fSPeter Avalos.Fl R
1122cb5eb4f1SPeter Avalosand
1123cb5eb4f1SPeter Avalos.Fl D
112418de8d7fSPeter Avalosoptions (see above).
112599e85e0dSPeter AvalosIt also allows the cancellation of existing port-forwardings
112699e85e0dSPeter Avaloswith
112718de8d7fSPeter Avalos.Sm off
112899e85e0dSPeter Avalos.Fl KL Oo Ar bind_address : Oc Ar port
112918de8d7fSPeter Avalos.Sm on
113099e85e0dSPeter Avalosfor local,
113199e85e0dSPeter Avalos.Sm off
113299e85e0dSPeter Avalos.Fl KR Oo Ar bind_address : Oc Ar port
113399e85e0dSPeter Avalos.Sm on
113499e85e0dSPeter Avalosfor remote and
113599e85e0dSPeter Avalos.Sm off
113699e85e0dSPeter Avalos.Fl KD Oo Ar bind_address : Oc Ar port
113799e85e0dSPeter Avalos.Sm on
113899e85e0dSPeter Avalosfor dynamic port-forwardings.
113918de8d7fSPeter Avalos.Ic !\& Ns Ar command
114018de8d7fSPeter Avalosallows the user to execute a local command if the
114118de8d7fSPeter Avalos.Ic PermitLocalCommand
114218de8d7fSPeter Avalosoption is enabled in
114318de8d7fSPeter Avalos.Xr ssh_config 5 .
114418de8d7fSPeter AvalosBasic help is available, using the
114518de8d7fSPeter Avalos.Fl h
114618de8d7fSPeter Avalosoption.
114718de8d7fSPeter Avalos.It Cm ~R
114818de8d7fSPeter AvalosRequest rekeying of the connection
1149e9778795SPeter Avalos(only useful if the peer supports it).
115036e94dc5SPeter Avalos.It Cm ~V
115136e94dc5SPeter AvalosDecrease the verbosity
115236e94dc5SPeter Avalos.Pq Ic LogLevel
115336e94dc5SPeter Avaloswhen errors are being written to stderr.
115436e94dc5SPeter Avalos.It Cm ~v
115536e94dc5SPeter AvalosIncrease the verbosity
115636e94dc5SPeter Avalos.Pq Ic LogLevel
115736e94dc5SPeter Avaloswhen errors are being written to stderr.
115818de8d7fSPeter Avalos.El
115918de8d7fSPeter Avalos.Sh TCP FORWARDING
1160664f4763SzrjForwarding of arbitrary TCP connections over a secure channel
1161664f4763Szrjcan be specified either on the command line or in a configuration file.
116218de8d7fSPeter AvalosOne possible application of TCP forwarding is a secure connection to a
116318de8d7fSPeter Avalosmail server; another is going through firewalls.
116418de8d7fSPeter Avalos.Pp
1165664f4763SzrjIn the example below, we look at encrypting communication for an IRC client,
1166664f4763Szrjeven though the IRC server it connects to does not directly
1167664f4763Szrjsupport encrypted communication.
116818de8d7fSPeter AvalosThis works as follows:
116918de8d7fSPeter Avalosthe user connects to the remote host using
117018de8d7fSPeter Avalos.Nm ,
1171664f4763Szrjspecifying the ports to be used to forward the connection.
1172664f4763SzrjAfter that it is possible to start the program locally,
117318de8d7fSPeter Avalosand
117418de8d7fSPeter Avalos.Nm
1175664f4763Szrjwill encrypt and forward the connection to the remote server.
117618de8d7fSPeter Avalos.Pp
1177664f4763SzrjThe following example tunnels an IRC session from the client
1178664f4763Szrjto an IRC server at
117918de8d7fSPeter Avalos.Dq server.example.com ,
118018de8d7fSPeter Avalosjoining channel
118118de8d7fSPeter Avalos.Dq #users ,
118218de8d7fSPeter Avalosnickname
118318de8d7fSPeter Avalos.Dq pinky ,
1184664f4763Szrjusing the standard IRC port, 6667:
1185664f4763Szrj.Bd -literal -offset 4n
1186664f4763Szrj$ ssh -f -L 6667:localhost:6667 server.example.com sleep 10
1187664f4763Szrj$ irc -c '#users' pinky IRC/127.0.0.1
1188664f4763Szrj.Ed
118918de8d7fSPeter Avalos.Pp
119018de8d7fSPeter AvalosThe
119118de8d7fSPeter Avalos.Fl f
119218de8d7fSPeter Avalosoption backgrounds
119318de8d7fSPeter Avalos.Nm
119418de8d7fSPeter Avalosand the remote command
119518de8d7fSPeter Avalos.Dq sleep 10
119618de8d7fSPeter Avalosis specified to allow an amount of time
119718de8d7fSPeter Avalos(10 seconds, in the example)
1198664f4763Szrjto start the program which is going to use the tunnel.
119918de8d7fSPeter AvalosIf no connections are made within the time specified,
120018de8d7fSPeter Avalos.Nm
120118de8d7fSPeter Avaloswill exit.
120218de8d7fSPeter Avalos.Sh X11 FORWARDING
120318de8d7fSPeter AvalosIf the
120418de8d7fSPeter Avalos.Cm ForwardX11
120518de8d7fSPeter Avalosvariable is set to
120618de8d7fSPeter Avalos.Dq yes
120718de8d7fSPeter Avalos(or see the description of the
120818de8d7fSPeter Avalos.Fl X ,
120918de8d7fSPeter Avalos.Fl x ,
121018de8d7fSPeter Avalosand
121118de8d7fSPeter Avalos.Fl Y
121218de8d7fSPeter Avalosoptions above)
121318de8d7fSPeter Avalosand the user is using X11 (the
121418de8d7fSPeter Avalos.Ev DISPLAY
121518de8d7fSPeter Avalosenvironment variable is set), the connection to the X11 display is
121618de8d7fSPeter Avalosautomatically forwarded to the remote side in such a way that any X11
121718de8d7fSPeter Avalosprograms started from the shell (or command) will go through the
121818de8d7fSPeter Avalosencrypted channel, and the connection to the real X server will be made
121918de8d7fSPeter Avalosfrom the local machine.
122018de8d7fSPeter AvalosThe user should not manually set
122118de8d7fSPeter Avalos.Ev DISPLAY .
122218de8d7fSPeter AvalosForwarding of X11 connections can be
122318de8d7fSPeter Avalosconfigured on the command line or in configuration files.
122418de8d7fSPeter Avalos.Pp
122518de8d7fSPeter AvalosThe
122618de8d7fSPeter Avalos.Ev DISPLAY
122718de8d7fSPeter Avalosvalue set by
122818de8d7fSPeter Avalos.Nm
122918de8d7fSPeter Avaloswill point to the server machine, but with a display number greater than zero.
123018de8d7fSPeter AvalosThis is normal, and happens because
123118de8d7fSPeter Avalos.Nm
123218de8d7fSPeter Avaloscreates a
123318de8d7fSPeter Avalos.Dq proxy
123418de8d7fSPeter AvalosX server on the server machine for forwarding the
123518de8d7fSPeter Avalosconnections over the encrypted channel.
123618de8d7fSPeter Avalos.Pp
123718de8d7fSPeter Avalos.Nm
123818de8d7fSPeter Avaloswill also automatically set up Xauthority data on the server machine.
123918de8d7fSPeter AvalosFor this purpose, it will generate a random authorization cookie,
124018de8d7fSPeter Avalosstore it in Xauthority on the server, and verify that any forwarded
124118de8d7fSPeter Avalosconnections carry this cookie and replace it by the real cookie when
124218de8d7fSPeter Avalosthe connection is opened.
124318de8d7fSPeter AvalosThe real authentication cookie is never
124418de8d7fSPeter Avalossent to the server machine (and no cookies are sent in the plain).
124518de8d7fSPeter Avalos.Pp
124618de8d7fSPeter AvalosIf the
124718de8d7fSPeter Avalos.Cm ForwardAgent
124818de8d7fSPeter Avalosvariable is set to
124918de8d7fSPeter Avalos.Dq yes
125018de8d7fSPeter Avalos(or see the description of the
125118de8d7fSPeter Avalos.Fl A
125218de8d7fSPeter Avalosand
125318de8d7fSPeter Avalos.Fl a
125418de8d7fSPeter Avalosoptions above) and
125518de8d7fSPeter Avalosthe user is using an authentication agent, the connection to the agent
125618de8d7fSPeter Avalosis automatically forwarded to the remote side.
125718de8d7fSPeter Avalos.Sh VERIFYING HOST KEYS
125818de8d7fSPeter AvalosWhen connecting to a server for the first time,
125918de8d7fSPeter Avalosa fingerprint of the server's public key is presented to the user
126018de8d7fSPeter Avalos(unless the option
126118de8d7fSPeter Avalos.Cm StrictHostKeyChecking
126218de8d7fSPeter Avaloshas been disabled).
126318de8d7fSPeter AvalosFingerprints can be determined using
126418de8d7fSPeter Avalos.Xr ssh-keygen 1 :
126518de8d7fSPeter Avalos.Pp
126618de8d7fSPeter Avalos.Dl $ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key
126718de8d7fSPeter Avalos.Pp
126818de8d7fSPeter AvalosIf the fingerprint is already known, it can be matched
126918de8d7fSPeter Avalosand the key can be accepted or rejected.
1270e9778795SPeter AvalosIf only legacy (MD5) fingerprints for the server are available, the
1271e9778795SPeter Avalos.Xr ssh-keygen 1
1272e9778795SPeter Avalos.Fl E
1273e9778795SPeter Avalosoption may be used to downgrade the fingerprint algorithm to match.
1274e9778795SPeter Avalos.Pp
127518de8d7fSPeter AvalosBecause of the difficulty of comparing host keys
1276e9778795SPeter Avalosjust by looking at fingerprint strings,
127718de8d7fSPeter Avalosthere is also support to compare host keys visually,
127818de8d7fSPeter Avalosusing
127918de8d7fSPeter Avalos.Em random art .
128018de8d7fSPeter AvalosBy setting the
128118de8d7fSPeter Avalos.Cm VisualHostKey
128218de8d7fSPeter Avalosoption to
128318de8d7fSPeter Avalos.Dq yes ,
128418de8d7fSPeter Avalosa small ASCII graphic gets displayed on every login to a server, no matter
128518de8d7fSPeter Avalosif the session itself is interactive or not.
128618de8d7fSPeter AvalosBy learning the pattern a known server produces, a user can easily
128718de8d7fSPeter Avalosfind out that the host key has changed when a completely different pattern
128818de8d7fSPeter Avalosis displayed.
128918de8d7fSPeter AvalosBecause these patterns are not unambiguous however, a pattern that looks
129018de8d7fSPeter Avalossimilar to the pattern remembered only gives a good probability that the
129118de8d7fSPeter Avaloshost key is the same, not guaranteed proof.
129218de8d7fSPeter Avalos.Pp
129318de8d7fSPeter AvalosTo get a listing of the fingerprints along with their random art for
129418de8d7fSPeter Avalosall known hosts, the following command line can be used:
129518de8d7fSPeter Avalos.Pp
129618de8d7fSPeter Avalos.Dl $ ssh-keygen -lv -f ~/.ssh/known_hosts
129718de8d7fSPeter Avalos.Pp
129818de8d7fSPeter AvalosIf the fingerprint is unknown,
129918de8d7fSPeter Avalosan alternative method of verification is available:
130018de8d7fSPeter AvalosSSH fingerprints verified by DNS.
130118de8d7fSPeter AvalosAn additional resource record (RR),
130218de8d7fSPeter AvalosSSHFP,
130318de8d7fSPeter Avalosis added to a zonefile
130418de8d7fSPeter Avalosand the connecting client is able to match the fingerprint
130518de8d7fSPeter Avaloswith that of the key presented.
130618de8d7fSPeter Avalos.Pp
130718de8d7fSPeter AvalosIn this example, we are connecting a client to a server,
130818de8d7fSPeter Avalos.Dq host.example.com .
130918de8d7fSPeter AvalosThe SSHFP resource records should first be added to the zonefile for
131018de8d7fSPeter Avaloshost.example.com:
131118de8d7fSPeter Avalos.Bd -literal -offset indent
131218de8d7fSPeter Avalos$ ssh-keygen -r host.example.com.
131318de8d7fSPeter Avalos.Ed
131418de8d7fSPeter Avalos.Pp
131518de8d7fSPeter AvalosThe output lines will have to be added to the zonefile.
131618de8d7fSPeter AvalosTo check that the zone is answering fingerprint queries:
131718de8d7fSPeter Avalos.Pp
131818de8d7fSPeter Avalos.Dl $ dig -t SSHFP host.example.com
131918de8d7fSPeter Avalos.Pp
132018de8d7fSPeter AvalosFinally the client connects:
132118de8d7fSPeter Avalos.Bd -literal -offset indent
132218de8d7fSPeter Avalos$ ssh -o "VerifyHostKeyDNS ask" host.example.com
132318de8d7fSPeter Avalos[...]
132418de8d7fSPeter AvalosMatching host key fingerprint found in DNS.
132518de8d7fSPeter AvalosAre you sure you want to continue connecting (yes/no)?
132618de8d7fSPeter Avalos.Ed
132718de8d7fSPeter Avalos.Pp
132818de8d7fSPeter AvalosSee the
132918de8d7fSPeter Avalos.Cm VerifyHostKeyDNS
133018de8d7fSPeter Avalosoption in
133118de8d7fSPeter Avalos.Xr ssh_config 5
133218de8d7fSPeter Avalosfor more information.
133318de8d7fSPeter Avalos.Sh SSH-BASED VIRTUAL PRIVATE NETWORKS
133418de8d7fSPeter Avalos.Nm
133518de8d7fSPeter Avaloscontains support for Virtual Private Network (VPN) tunnelling
133618de8d7fSPeter Avalosusing the
133718de8d7fSPeter Avalos.Xr tun 4
133818de8d7fSPeter Avalosnetwork pseudo-device,
133918de8d7fSPeter Avalosallowing two networks to be joined securely.
134018de8d7fSPeter AvalosThe
134118de8d7fSPeter Avalos.Xr sshd_config 5
134218de8d7fSPeter Avalosconfiguration option
134318de8d7fSPeter Avalos.Cm PermitTunnel
134418de8d7fSPeter Avaloscontrols whether the server supports this,
134518de8d7fSPeter Avalosand at what level (layer 2 or 3 traffic).
134618de8d7fSPeter Avalos.Pp
134718de8d7fSPeter AvalosThe following example would connect client network 10.0.50.0/24
134818de8d7fSPeter Avaloswith remote network 10.0.99.0/24 using a point-to-point connection
134918de8d7fSPeter Avalosfrom 10.1.1.1 to 10.1.1.2,
135018de8d7fSPeter Avalosprovided that the SSH server running on the gateway to the remote network,
135118de8d7fSPeter Avalosat 192.168.1.15, allows it.
135218de8d7fSPeter Avalos.Pp
135318de8d7fSPeter AvalosOn the client:
135418de8d7fSPeter Avalos.Bd -literal -offset indent
135518de8d7fSPeter Avalos# ssh -f -w 0:1 192.168.1.15 true
135618de8d7fSPeter Avalos# ifconfig tun0 10.1.1.1 10.1.1.2 netmask 255.255.255.252
135718de8d7fSPeter Avalos# route add 10.0.99.0/24 10.1.1.2
135818de8d7fSPeter Avalos.Ed
135918de8d7fSPeter Avalos.Pp
136018de8d7fSPeter AvalosOn the server:
136118de8d7fSPeter Avalos.Bd -literal -offset indent
136218de8d7fSPeter Avalos# ifconfig tun1 10.1.1.2 10.1.1.1 netmask 255.255.255.252
136318de8d7fSPeter Avalos# route add 10.0.50.0/24 10.1.1.1
136418de8d7fSPeter Avalos.Ed
136518de8d7fSPeter Avalos.Pp
136618de8d7fSPeter AvalosClient access may be more finely tuned via the
136718de8d7fSPeter Avalos.Pa /root/.ssh/authorized_keys
136818de8d7fSPeter Avalosfile (see below) and the
136918de8d7fSPeter Avalos.Cm PermitRootLogin
137018de8d7fSPeter Avalosserver option.
137118de8d7fSPeter AvalosThe following entry would permit connections on
137218de8d7fSPeter Avalos.Xr tun 4
137318de8d7fSPeter Avalosdevice 1 from user
137418de8d7fSPeter Avalos.Dq jane
137518de8d7fSPeter Avalosand on tun device 2 from user
137618de8d7fSPeter Avalos.Dq john ,
137718de8d7fSPeter Avalosif
137818de8d7fSPeter Avalos.Cm PermitRootLogin
137918de8d7fSPeter Avalosis set to
138018de8d7fSPeter Avalos.Dq forced-commands-only :
138118de8d7fSPeter Avalos.Bd -literal -offset 2n
138218de8d7fSPeter Avalostunnel="1",command="sh /etc/netstart tun1" ssh-rsa ... jane
138318de8d7fSPeter Avalostunnel="2",command="sh /etc/netstart tun2" ssh-rsa ... john
138418de8d7fSPeter Avalos.Ed
138518de8d7fSPeter Avalos.Pp
138618de8d7fSPeter AvalosSince an SSH-based setup entails a fair amount of overhead,
138718de8d7fSPeter Avalosit may be more suited to temporary setups,
138818de8d7fSPeter Avalossuch as for wireless VPNs.
138918de8d7fSPeter AvalosMore permanent VPNs are better provided by tools such as
139018de8d7fSPeter Avalos.Xr ipsecctl 8
139118de8d7fSPeter Avalosand
139218de8d7fSPeter Avalos.Xr isakmpd 8 .
139318de8d7fSPeter Avalos.Sh ENVIRONMENT
139418de8d7fSPeter Avalos.Nm
139518de8d7fSPeter Avaloswill normally set the following environment variables:
139618de8d7fSPeter Avalos.Bl -tag -width "SSH_ORIGINAL_COMMAND"
139718de8d7fSPeter Avalos.It Ev DISPLAY
139818de8d7fSPeter AvalosThe
139918de8d7fSPeter Avalos.Ev DISPLAY
140018de8d7fSPeter Avalosvariable indicates the location of the X11 server.
140118de8d7fSPeter AvalosIt is automatically set by
140218de8d7fSPeter Avalos.Nm
140318de8d7fSPeter Avalosto point to a value of the form
140418de8d7fSPeter Avalos.Dq hostname:n ,
140518de8d7fSPeter Avaloswhere
140618de8d7fSPeter Avalos.Dq hostname
140718de8d7fSPeter Avalosindicates the host where the shell runs, and
140818de8d7fSPeter Avalos.Sq n
140918de8d7fSPeter Avalosis an integer \*(Ge 1.
141018de8d7fSPeter Avalos.Nm
141118de8d7fSPeter Avalosuses this special value to forward X11 connections over the secure
141218de8d7fSPeter Avaloschannel.
141318de8d7fSPeter AvalosThe user should normally not set
141418de8d7fSPeter Avalos.Ev DISPLAY
141518de8d7fSPeter Avalosexplicitly, as that
141618de8d7fSPeter Avaloswill render the X11 connection insecure (and will require the user to
141718de8d7fSPeter Avalosmanually copy any required authorization cookies).
141818de8d7fSPeter Avalos.It Ev HOME
141918de8d7fSPeter AvalosSet to the path of the user's home directory.
142018de8d7fSPeter Avalos.It Ev LOGNAME
142118de8d7fSPeter AvalosSynonym for
142218de8d7fSPeter Avalos.Ev USER ;
142318de8d7fSPeter Avalosset for compatibility with systems that use this variable.
142418de8d7fSPeter Avalos.It Ev MAIL
142518de8d7fSPeter AvalosSet to the path of the user's mailbox.
142618de8d7fSPeter Avalos.It Ev PATH
142718de8d7fSPeter AvalosSet to the default
142818de8d7fSPeter Avalos.Ev PATH ,
142918de8d7fSPeter Avalosas specified when compiling
143018de8d7fSPeter Avalos.Nm .
143118de8d7fSPeter Avalos.It Ev SSH_ASKPASS
143218de8d7fSPeter AvalosIf
143318de8d7fSPeter Avalos.Nm
143418de8d7fSPeter Avalosneeds a passphrase, it will read the passphrase from the current
143518de8d7fSPeter Avalosterminal if it was run from a terminal.
143618de8d7fSPeter AvalosIf
143718de8d7fSPeter Avalos.Nm
143818de8d7fSPeter Avalosdoes not have a terminal associated with it but
143918de8d7fSPeter Avalos.Ev DISPLAY
144018de8d7fSPeter Avalosand
144118de8d7fSPeter Avalos.Ev SSH_ASKPASS
144218de8d7fSPeter Avalosare set, it will execute the program specified by
144318de8d7fSPeter Avalos.Ev SSH_ASKPASS
144418de8d7fSPeter Avalosand open an X11 window to read the passphrase.
144518de8d7fSPeter AvalosThis is particularly useful when calling
144618de8d7fSPeter Avalos.Nm
144718de8d7fSPeter Avalosfrom a
144818de8d7fSPeter Avalos.Pa .xsession
144918de8d7fSPeter Avalosor related script.
145018de8d7fSPeter Avalos(Note that on some machines it
145118de8d7fSPeter Avalosmay be necessary to redirect the input from
145218de8d7fSPeter Avalos.Pa /dev/null
145318de8d7fSPeter Avalosto make this work.)
145450a69bb5SSascha Wildner.It Ev SSH_ASKPASS_REQUIRE
145550a69bb5SSascha WildnerAllows further control over the use of an askpass program.
145650a69bb5SSascha WildnerIf this variable is set to
145750a69bb5SSascha Wildner.Dq never
145850a69bb5SSascha Wildnerthen
145950a69bb5SSascha Wildner.Nm
146050a69bb5SSascha Wildnerwill never attempt to use one.
146150a69bb5SSascha WildnerIf it is set to
146250a69bb5SSascha Wildner.Dq prefer ,
146350a69bb5SSascha Wildnerthen
146450a69bb5SSascha Wildner.Nm
146550a69bb5SSascha Wildnerwill prefer to use the askpass program instead of the TTY when requesting
146650a69bb5SSascha Wildnerpasswords.
146750a69bb5SSascha WildnerFinally, if the variable is set to
146850a69bb5SSascha Wildner.Dq force ,
146950a69bb5SSascha Wildnerthen the askpass program will be used for all passphrase input regardless
147050a69bb5SSascha Wildnerof whether
147150a69bb5SSascha Wildner.Ev DISPLAY
147250a69bb5SSascha Wildneris set.
147318de8d7fSPeter Avalos.It Ev SSH_AUTH_SOCK
147418de8d7fSPeter AvalosIdentifies the path of a
147518de8d7fSPeter Avalos.Ux Ns -domain
147618de8d7fSPeter Avalossocket used to communicate with the agent.
147718de8d7fSPeter Avalos.It Ev SSH_CONNECTION
147818de8d7fSPeter AvalosIdentifies the client and server ends of the connection.
147918de8d7fSPeter AvalosThe variable contains
148018de8d7fSPeter Avalosfour space-separated values: client IP address, client port number,
148118de8d7fSPeter Avalosserver IP address, and server port number.
148218de8d7fSPeter Avalos.It Ev SSH_ORIGINAL_COMMAND
148318de8d7fSPeter AvalosThis variable contains the original command line if a forced command
148418de8d7fSPeter Avalosis executed.
148518de8d7fSPeter AvalosIt can be used to extract the original arguments.
148618de8d7fSPeter Avalos.It Ev SSH_TTY
148718de8d7fSPeter AvalosThis is set to the name of the tty (path to the device) associated
148818de8d7fSPeter Avaloswith the current shell or command.
148918de8d7fSPeter AvalosIf the current session has no tty,
149018de8d7fSPeter Avalosthis variable is not set.
1491664f4763Szrj.It Ev SSH_TUNNEL
1492664f4763SzrjOptionally set by
1493664f4763Szrj.Xr sshd 8
1494664f4763Szrjto contain the interface names assigned if tunnel forwarding was
1495664f4763Szrjrequested by the client.
1496664f4763Szrj.It Ev SSH_USER_AUTH
1497664f4763SzrjOptionally set by
1498664f4763Szrj.Xr sshd 8 ,
1499664f4763Szrjthis variable may contain a pathname to a file that lists the authentication
1500664f4763Szrjmethods successfully used when the session was established, including any
1501664f4763Szrjpublic keys that were used.
150218de8d7fSPeter Avalos.It Ev TZ
150318de8d7fSPeter AvalosThis variable is set to indicate the present time zone if it
150418de8d7fSPeter Avaloswas set when the daemon was started (i.e. the daemon passes the value
150518de8d7fSPeter Avaloson to new connections).
150618de8d7fSPeter Avalos.It Ev USER
150718de8d7fSPeter AvalosSet to the name of the user logging in.
150818de8d7fSPeter Avalos.El
150918de8d7fSPeter Avalos.Pp
151018de8d7fSPeter AvalosAdditionally,
151118de8d7fSPeter Avalos.Nm
151218de8d7fSPeter Avalosreads
151318de8d7fSPeter Avalos.Pa ~/.ssh/environment ,
151418de8d7fSPeter Avalosand adds lines of the format
151518de8d7fSPeter Avalos.Dq VARNAME=value
151618de8d7fSPeter Avalosto the environment if the file exists and users are allowed to
151718de8d7fSPeter Avaloschange their environment.
151818de8d7fSPeter AvalosFor more information, see the
151918de8d7fSPeter Avalos.Cm PermitUserEnvironment
152018de8d7fSPeter Avalosoption in
152118de8d7fSPeter Avalos.Xr sshd_config 5 .
152218de8d7fSPeter Avalos.Sh FILES
152318de8d7fSPeter Avalos.Bl -tag -width Ds -compact
15249f304aafSPeter Avalos.It Pa ~/.rhosts
152518de8d7fSPeter AvalosThis file is used for host-based authentication (see above).
152618de8d7fSPeter AvalosOn some machines this file may need to be
152718de8d7fSPeter Avalosworld-readable if the user's home directory is on an NFS partition,
152818de8d7fSPeter Avalosbecause
152918de8d7fSPeter Avalos.Xr sshd 8
153018de8d7fSPeter Avalosreads it as root.
153118de8d7fSPeter AvalosAdditionally, this file must be owned by the user,
153218de8d7fSPeter Avalosand must not have write permissions for anyone else.
153318de8d7fSPeter AvalosThe recommended
153418de8d7fSPeter Avalospermission for most machines is read/write for the user, and not
153518de8d7fSPeter Avalosaccessible by others.
153618de8d7fSPeter Avalos.Pp
15379f304aafSPeter Avalos.It Pa ~/.shosts
153818de8d7fSPeter AvalosThis file is used in exactly the same way as
153918de8d7fSPeter Avalos.Pa .rhosts ,
154018de8d7fSPeter Avalosbut allows host-based authentication without permitting login with
154118de8d7fSPeter Avalosrlogin/rsh.
154218de8d7fSPeter Avalos.Pp
15439f304aafSPeter Avalos.It Pa ~/.ssh/
154418de8d7fSPeter AvalosThis directory is the default location for all user-specific configuration
154518de8d7fSPeter Avalosand authentication information.
154618de8d7fSPeter AvalosThere is no general requirement to keep the entire contents of this directory
154718de8d7fSPeter Avalossecret, but the recommended permissions are read/write/execute for the user,
154818de8d7fSPeter Avalosand not accessible by others.
154918de8d7fSPeter Avalos.Pp
15509f304aafSPeter Avalos.It Pa ~/.ssh/authorized_keys
1551*ba1276acSMatthew DillonLists the public keys (ECDSA, Ed25519, RSA)
155236e94dc5SPeter Avalosthat can be used for logging in as this user.
155318de8d7fSPeter AvalosThe format of this file is described in the
155418de8d7fSPeter Avalos.Xr sshd 8
155518de8d7fSPeter Avalosmanual page.
155618de8d7fSPeter AvalosThis file is not highly sensitive, but the recommended
155718de8d7fSPeter Avalospermissions are read/write for the user, and not accessible by others.
155818de8d7fSPeter Avalos.Pp
15599f304aafSPeter Avalos.It Pa ~/.ssh/config
156018de8d7fSPeter AvalosThis is the per-user configuration file.
156118de8d7fSPeter AvalosThe file format and configuration options are described in
156218de8d7fSPeter Avalos.Xr ssh_config 5 .
156318de8d7fSPeter AvalosBecause of the potential for abuse, this file must have strict permissions:
156436e94dc5SPeter Avalosread/write for the user, and not writable by others.
156518de8d7fSPeter Avalos.Pp
15669f304aafSPeter Avalos.It Pa ~/.ssh/environment
156718de8d7fSPeter AvalosContains additional definitions for environment variables; see
156818de8d7fSPeter Avalos.Sx ENVIRONMENT ,
156918de8d7fSPeter Avalosabove.
157018de8d7fSPeter Avalos.Pp
15719f304aafSPeter Avalos.It Pa ~/.ssh/id_ecdsa
15720cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ecdsa_sk
157336e94dc5SPeter Avalos.It Pa ~/.ssh/id_ed25519
15740cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ed25519_sk
15759f304aafSPeter Avalos.It Pa ~/.ssh/id_rsa
157618de8d7fSPeter AvalosContains the private key for authentication.
157718de8d7fSPeter AvalosThese files
157818de8d7fSPeter Avaloscontain sensitive data and should be readable by the user but not
157918de8d7fSPeter Avalosaccessible by others (read/write/execute).
158018de8d7fSPeter Avalos.Nm
158118de8d7fSPeter Avaloswill simply ignore a private key file if it is accessible by others.
158218de8d7fSPeter AvalosIt is possible to specify a passphrase when
158318de8d7fSPeter Avalosgenerating the key which will be used to encrypt the
1584664f4763Szrjsensitive part of this file using AES-128.
158518de8d7fSPeter Avalos.Pp
15869f304aafSPeter Avalos.It Pa ~/.ssh/id_ecdsa.pub
15870cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ecdsa_sk.pub
158836e94dc5SPeter Avalos.It Pa ~/.ssh/id_ed25519.pub
15890cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ed25519_sk.pub
15909f304aafSPeter Avalos.It Pa ~/.ssh/id_rsa.pub
159118de8d7fSPeter AvalosContains the public key for authentication.
159218de8d7fSPeter AvalosThese files are not
159318de8d7fSPeter Avalossensitive and can (but need not) be readable by anyone.
159418de8d7fSPeter Avalos.Pp
15959f304aafSPeter Avalos.It Pa ~/.ssh/known_hosts
159618de8d7fSPeter AvalosContains a list of host keys for all hosts the user has logged into
159718de8d7fSPeter Avalosthat are not already in the systemwide list of known host keys.
159818de8d7fSPeter AvalosSee
159918de8d7fSPeter Avalos.Xr sshd 8
160018de8d7fSPeter Avalosfor further details of the format of this file.
160118de8d7fSPeter Avalos.Pp
16029f304aafSPeter Avalos.It Pa ~/.ssh/rc
160318de8d7fSPeter AvalosCommands in this file are executed by
160418de8d7fSPeter Avalos.Nm
160518de8d7fSPeter Avaloswhen the user logs in, just before the user's shell (or command) is
160618de8d7fSPeter Avalosstarted.
160718de8d7fSPeter AvalosSee the
160818de8d7fSPeter Avalos.Xr sshd 8
160918de8d7fSPeter Avalosmanual page for more information.
161018de8d7fSPeter Avalos.Pp
16119f304aafSPeter Avalos.It Pa /etc/hosts.equiv
161218de8d7fSPeter AvalosThis file is for host-based authentication (see above).
161318de8d7fSPeter AvalosIt should only be writable by root.
161418de8d7fSPeter Avalos.Pp
16159f304aafSPeter Avalos.It Pa /etc/shosts.equiv
161618de8d7fSPeter AvalosThis file is used in exactly the same way as
161718de8d7fSPeter Avalos.Pa hosts.equiv ,
161818de8d7fSPeter Avalosbut allows host-based authentication without permitting login with
161918de8d7fSPeter Avalosrlogin/rsh.
162018de8d7fSPeter Avalos.Pp
162118de8d7fSPeter Avalos.It Pa /etc/ssh/ssh_config
162218de8d7fSPeter AvalosSystemwide configuration file.
162318de8d7fSPeter AvalosThe file format and configuration options are described in
162418de8d7fSPeter Avalos.Xr ssh_config 5 .
162518de8d7fSPeter Avalos.Pp
16269f304aafSPeter Avalos.It Pa /etc/ssh/ssh_host_ecdsa_key
162736e94dc5SPeter Avalos.It Pa /etc/ssh/ssh_host_ed25519_key
16289f304aafSPeter Avalos.It Pa /etc/ssh/ssh_host_rsa_key
162999e85e0dSPeter AvalosThese files contain the private parts of the host keys
163018de8d7fSPeter Avalosand are used for host-based authentication.
163118de8d7fSPeter Avalos.Pp
16329f304aafSPeter Avalos.It Pa /etc/ssh/ssh_known_hosts
163318de8d7fSPeter AvalosSystemwide list of known host keys.
163418de8d7fSPeter AvalosThis file should be prepared by the
163518de8d7fSPeter Avalossystem administrator to contain the public host keys of all machines in the
163618de8d7fSPeter Avalosorganization.
163718de8d7fSPeter AvalosIt should be world-readable.
163818de8d7fSPeter AvalosSee
163918de8d7fSPeter Avalos.Xr sshd 8
164018de8d7fSPeter Avalosfor further details of the format of this file.
164118de8d7fSPeter Avalos.Pp
16429f304aafSPeter Avalos.It Pa /etc/ssh/sshrc
164318de8d7fSPeter AvalosCommands in this file are executed by
164418de8d7fSPeter Avalos.Nm
164518de8d7fSPeter Avaloswhen the user logs in, just before the user's shell (or command) is started.
164618de8d7fSPeter AvalosSee the
164718de8d7fSPeter Avalos.Xr sshd 8
164818de8d7fSPeter Avalosmanual page for more information.
164918de8d7fSPeter Avalos.El
16509f304aafSPeter Avalos.Sh EXIT STATUS
16519f304aafSPeter Avalos.Nm
16529f304aafSPeter Avalosexits with the exit status of the remote command or with 255
16539f304aafSPeter Avalosif an error occurred.
165418de8d7fSPeter Avalos.Sh SEE ALSO
165518de8d7fSPeter Avalos.Xr scp 1 ,
165618de8d7fSPeter Avalos.Xr sftp 1 ,
165718de8d7fSPeter Avalos.Xr ssh-add 1 ,
165818de8d7fSPeter Avalos.Xr ssh-agent 1 ,
165918de8d7fSPeter Avalos.Xr ssh-keygen 1 ,
166018de8d7fSPeter Avalos.Xr ssh-keyscan 1 ,
166118de8d7fSPeter Avalos.Xr tun 4 ,
166218de8d7fSPeter Avalos.Xr ssh_config 5 ,
166318de8d7fSPeter Avalos.Xr ssh-keysign 8 ,
166418de8d7fSPeter Avalos.Xr sshd 8
166536e94dc5SPeter Avalos.Sh STANDARDS
166618de8d7fSPeter Avalos.Rs
166736e94dc5SPeter Avalos.%A S. Lehtinen
166836e94dc5SPeter Avalos.%A C. Lonvick
166936e94dc5SPeter Avalos.%D January 2006
167018de8d7fSPeter Avalos.%R RFC 4250
167136e94dc5SPeter Avalos.%T The Secure Shell (SSH) Protocol Assigned Numbers
167218de8d7fSPeter Avalos.Re
167336e94dc5SPeter Avalos.Pp
167418de8d7fSPeter Avalos.Rs
167536e94dc5SPeter Avalos.%A T. Ylonen
167636e94dc5SPeter Avalos.%A C. Lonvick
167736e94dc5SPeter Avalos.%D January 2006
167818de8d7fSPeter Avalos.%R RFC 4251
167936e94dc5SPeter Avalos.%T The Secure Shell (SSH) Protocol Architecture
168018de8d7fSPeter Avalos.Re
168136e94dc5SPeter Avalos.Pp
168218de8d7fSPeter Avalos.Rs
168336e94dc5SPeter Avalos.%A T. Ylonen
168436e94dc5SPeter Avalos.%A C. Lonvick
168536e94dc5SPeter Avalos.%D January 2006
168618de8d7fSPeter Avalos.%R RFC 4252
168736e94dc5SPeter Avalos.%T The Secure Shell (SSH) Authentication Protocol
168818de8d7fSPeter Avalos.Re
168936e94dc5SPeter Avalos.Pp
169018de8d7fSPeter Avalos.Rs
169136e94dc5SPeter Avalos.%A T. Ylonen
169236e94dc5SPeter Avalos.%A C. Lonvick
169336e94dc5SPeter Avalos.%D January 2006
169418de8d7fSPeter Avalos.%R RFC 4253
169536e94dc5SPeter Avalos.%T The Secure Shell (SSH) Transport Layer Protocol
169618de8d7fSPeter Avalos.Re
169736e94dc5SPeter Avalos.Pp
169818de8d7fSPeter Avalos.Rs
169936e94dc5SPeter Avalos.%A T. Ylonen
170036e94dc5SPeter Avalos.%A C. Lonvick
170136e94dc5SPeter Avalos.%D January 2006
170218de8d7fSPeter Avalos.%R RFC 4254
170336e94dc5SPeter Avalos.%T The Secure Shell (SSH) Connection Protocol
170418de8d7fSPeter Avalos.Re
170536e94dc5SPeter Avalos.Pp
170618de8d7fSPeter Avalos.Rs
170736e94dc5SPeter Avalos.%A J. Schlyter
170836e94dc5SPeter Avalos.%A W. Griffin
170936e94dc5SPeter Avalos.%D January 2006
171018de8d7fSPeter Avalos.%R RFC 4255
171136e94dc5SPeter Avalos.%T Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints
171218de8d7fSPeter Avalos.Re
171336e94dc5SPeter Avalos.Pp
171418de8d7fSPeter Avalos.Rs
171536e94dc5SPeter Avalos.%A F. Cusack
171636e94dc5SPeter Avalos.%A M. Forssen
171736e94dc5SPeter Avalos.%D January 2006
171818de8d7fSPeter Avalos.%R RFC 4256
171936e94dc5SPeter Avalos.%T Generic Message Exchange Authentication for the Secure Shell Protocol (SSH)
172018de8d7fSPeter Avalos.Re
172136e94dc5SPeter Avalos.Pp
172218de8d7fSPeter Avalos.Rs
172336e94dc5SPeter Avalos.%A J. Galbraith
172436e94dc5SPeter Avalos.%A P. Remaker
172536e94dc5SPeter Avalos.%D January 2006
172618de8d7fSPeter Avalos.%R RFC 4335
172736e94dc5SPeter Avalos.%T The Secure Shell (SSH) Session Channel Break Extension
172818de8d7fSPeter Avalos.Re
172936e94dc5SPeter Avalos.Pp
173018de8d7fSPeter Avalos.Rs
173136e94dc5SPeter Avalos.%A M. Bellare
173236e94dc5SPeter Avalos.%A T. Kohno
173336e94dc5SPeter Avalos.%A C. Namprempre
173436e94dc5SPeter Avalos.%D January 2006
173518de8d7fSPeter Avalos.%R RFC 4344
173636e94dc5SPeter Avalos.%T The Secure Shell (SSH) Transport Layer Encryption Modes
173718de8d7fSPeter Avalos.Re
173836e94dc5SPeter Avalos.Pp
173918de8d7fSPeter Avalos.Rs
174036e94dc5SPeter Avalos.%A B. Harris
174136e94dc5SPeter Avalos.%D January 2006
174218de8d7fSPeter Avalos.%R RFC 4345
174336e94dc5SPeter Avalos.%T Improved Arcfour Modes for the Secure Shell (SSH) Transport Layer Protocol
174418de8d7fSPeter Avalos.Re
174536e94dc5SPeter Avalos.Pp
174618de8d7fSPeter Avalos.Rs
174736e94dc5SPeter Avalos.%A M. Friedl
174836e94dc5SPeter Avalos.%A N. Provos
174936e94dc5SPeter Avalos.%A W. Simpson
175036e94dc5SPeter Avalos.%D March 2006
175118de8d7fSPeter Avalos.%R RFC 4419
175236e94dc5SPeter Avalos.%T Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol
175318de8d7fSPeter Avalos.Re
175436e94dc5SPeter Avalos.Pp
175518de8d7fSPeter Avalos.Rs
175636e94dc5SPeter Avalos.%A J. Galbraith
175736e94dc5SPeter Avalos.%A R. Thayer
175836e94dc5SPeter Avalos.%D November 2006
175918de8d7fSPeter Avalos.%R RFC 4716
176036e94dc5SPeter Avalos.%T The Secure Shell (SSH) Public Key File Format
176118de8d7fSPeter Avalos.Re
176236e94dc5SPeter Avalos.Pp
176318de8d7fSPeter Avalos.Rs
176436e94dc5SPeter Avalos.%A D. Stebila
176536e94dc5SPeter Avalos.%A J. Green
176636e94dc5SPeter Avalos.%D December 2009
17679f304aafSPeter Avalos.%R RFC 5656
176836e94dc5SPeter Avalos.%T Elliptic Curve Algorithm Integration in the Secure Shell Transport Layer
17699f304aafSPeter Avalos.Re
177036e94dc5SPeter Avalos.Pp
17719f304aafSPeter Avalos.Rs
177218de8d7fSPeter Avalos.%A A. Perrig
177318de8d7fSPeter Avalos.%A D. Song
177418de8d7fSPeter Avalos.%D 1999
177536e94dc5SPeter Avalos.%O International Workshop on Cryptographic Techniques and E-Commerce (CrypTEC '99)
177636e94dc5SPeter Avalos.%T Hash Visualization: a New Technique to improve Real-World Security
177718de8d7fSPeter Avalos.Re
177818de8d7fSPeter Avalos.Sh AUTHORS
177918de8d7fSPeter AvalosOpenSSH is a derivative of the original and free
178018de8d7fSPeter Avalosssh 1.2.12 release by Tatu Ylonen.
178118de8d7fSPeter AvalosAaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
178218de8d7fSPeter AvalosTheo de Raadt and Dug Song
178318de8d7fSPeter Avalosremoved many bugs, re-added newer features and
178418de8d7fSPeter Avaloscreated OpenSSH.
178518de8d7fSPeter AvalosMarkus Friedl contributed the support for SSH
178618de8d7fSPeter Avalosprotocol versions 1.5 and 2.0.
1787