secsh, ssh

OpenSSH SSH client (remote login program) 

Command


SYNOPSIS

secsh [-l login_name] hostname | user@hostname [command]

secsh [-afgknqstvxyACGKNTVXY46] [-b bind_address] [-c cipher_spec] [-e escape_char] [-i identity_file] [-l login_name] [-m mac_spec] [-o option] [-p port] [-D [bind_address:]port] [-E log_file] [-F configfile] [-J destination] [-L port:host:hostport] [-O ctl_cmd] [-Q cipher | mac | kex | key] [-R port:host:hostport] [-S ctl_path] [-W host:port] [hostname | user@hostname] [command]

ssh [-l login_name] hostname | user@hostname [command]

ssh [-afgknqstvxyACGKNTVXY46] [-b bind_address] [-c cipher_spec] [-e escape_char] [-i identity_file] [-l login_name] [-m mac_spec] [-o option] [-p port] [-D [bind_address:]port] [-E log_file] [-F configfile] [-J destination] [-L port:host:hostport] [-O ctl_cmd] [-Q cipher | mac | kex | key] [-R port:host:hostport] [-S ctl_path] [-W host:port] [hostname | user@hostname] [command]


DESCRIPTION

secsh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. You can also call this program as ssh. It is intended to provide secure encrypted communications between two untrusted hosts over an insecure network. X11 connections, arbitrary TCP ports and UNIX-domain sockets can also be forwarded over the secure channel.

secsh connects and logs into the specified destination, which may be specified as either [user@]hostname or a URI of the form ssh://[user@]hostname[:port]. The user must prove his/her identity to the remote machine using one of several methods (see below).

If a command is specified, it is executed on the remote host instead of a login shell.

Options

-a 

Disables forwarding of the authentication agent connection.

-A 

Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file.

Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent's UNIX-domain socket) can access the local agent through the forwarded connection. An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent.

-b bind_address 

Specifies the interface to transmit from on machines with multiple interfaces or aliased addresses.

-C 

Requests compression of all data (including stdin, stdout, stderr, and data for forwarded X11, TCP and UNIX-domain connections). The compression algorithm is the same used by gzip. Compression is desirable on modem lines and other slow connections, but will only slow down things on fast networks. The default value can be set on a host-by-host basis in the configuration files; see the Compression option.

-c cipher_spec 

Selects the cipher specification for encrypting the session. Selects the cipher specification for encrypting the session. cipher_spec is a comma-separated list of ciphers listed in order of preference. See the Ciphers keyword in secsh for more information.

-D [bind_address:]port 

Specifies a local "dynamic" application-level port forwarding. This works by allocating a socket to listen to port on the local side, optionally bound to a specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported, and secsh will act as a SOCKS server.

IPv6 addresses can be specified by enclosing the address in square brackets. Only the superuser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of localhost indicates that the listening port be bound for local use only, while an empty address or * indicates that the port should be available from all interfaces.

-E log_file 

Append debug logs to log_file instead of standard error.

-e ch|^ch|none 

Sets the escape character for sessions with a pty (default: ~). The escape character is only recognized at the beginning of a line. The escape character followed by a dot () closes the connection, followed by control-Z suspends the connection, and followed by itself sends the escape character once. Setting the character to none disables any escapes and makes the session fully transparent.

-F configfile 

Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration information in the registry is ignored. The default for the per-user configuration file is stored in the registry.

-f 

Requests secsh to go to background just before command execution. This is useful if secsh is going to ask for passwords or passphrases, but the user wants it in the background. This implies -n. The recommended way to start X11 programs at a remote site is with something like ssh -f host xterm.

If the ExitOnForwardFailure configuration option is set to yes, then a client started with -f will wait for all remote port forwards to be successfully established before placing itself in the background.

-G 

Causes ssh to print its configuration after evaluating the configuration, and it will then exit.

-g 

Allows remote hosts to connect to local forwarded ports. If used on a multiplexed connection, then this option must be specified on the master process.

-i identity_file 

Selects a file from which the identity (private key) for public key authentication is read. The default is $USERPROFILE/.ssh/id_dsa, $USERPROFILE/.ssh/id_ecdsa, $USERPROFILE/.ssh/id_ed25519 and $USERPROFILE/.ssh/id_rsa. Identity files may also be specified on a per-host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in configuration files). If no certificates have been explicitly specified by the CertificateFile directive, ssh will also try to load certificate information from the filename obtained by appending -cert.pub to identity filenames.

-Ismartcard_device 

Specifies which smartcard device to use. The argument is the device secsh should use to communicate with a smartcard used for storing the user's private RSA key.

-J destination 

Connect to the target host by first making a ssh connection to the jump host described by destination and then establishing a TCP forwarding to the ultimate destination from there. Multiple jump hops may be specified separated by comma characters. This is a shortcut to specify a ProxyJump configuration directive.

-K 

Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI credentials to the server.

-k 

Disables forwarding of GSSAPI credentials to the server.

-L port:host:hostport 
-L [bind_address:]port:remote_socket 
-L local_socket:host:hostport 
-L local_socket:remote_socket 

Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port, or Unix socket, on the remote side. This works by allocating a socket to listen to either a TCP port on the local side, optionally bound to the specified bind_address, or to a Unix socket. Whenever a connection is made to the local port or socket, the connection is forwarded over the secure channel, and a connection is made to either host port hostport, or the Unix socket remote_socket, from the remote machine. Port forwardings can also be specified in the configuration file. IPv6 addresses can be specified by enclosing the address in square brackets.

By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of localhost indicates that the listening port be bound for local use only, while an empty address or * indicates that the port should be available from all interfaces.

-l login_name 

Specifies the user to log in as on the remote machine. This also may be specified on a per-host basis in the configuration file.

-m mac_spec 

A comma-separated list of MAC (message authentication code) algorithms, specified in order of preference. See the MACs keyword for more information.

-n 

Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when secsh is run in the background. A common trick is to use this to run X11 programs on a remote machine. For example, ssh -n shadows.cs.hut.fi emacs & will start an emacs on shadows.cs.hut.fi, and the X11 connection will be automatically forwarded over an encrypted channel. The secsh program will be put in the background. (This does not work if secsh needs to ask for a password or passphrase; see also the -f option.)

-N 

Does not execute a remote command. This is useful for just forwarding ports.

-O ctl_cmd 

Control an active connection multiplexing master process. When the -O option is specified, the ctl_cmd argument is interpreted and passed to the master process. Valid commands are: check (check that the master process is running), forward (request forwardings without command execution), cancel (cancel forwardings), exit (request the master to exit), and stop (request the master to stop accepting further multiplexing requests).

-o option 

Specifies options in the format used in the configuration file. This is useful for specifying options for which there is no separate command-line flag.

-p port 

Specifies the port to connect to on the remote host.

-Q query_option 

Queries ssh for the algorithms supported for the specified version 2. The available features are: cipher (supported symmetric ciphers), cipher-auth (supported symmetric ciphers that support authenticated encryption), mac (supported message integrity codes), kex (key exchange algorithms), key (key types), key-cert (certificate key types), key-plain (non-certificate key types), and protocol-version (supported SSH protocol versions).

-q 

Quiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are displayed.

-R [bind_address:]port:host:hostport 
-R [bind_address:]port:local_socket 
-R remote_socket:host:hostport 
-R remote_socket:local_socket 
-R [bind_address:]port 

Specifies that connections to the given TCP port or Unix socket on the remote (server) host are to be forwarded to the local side.

This works by allocating a socket to listen to either a TCP port or to a Unix socket on the remote side. Whenever a connection is made to this port or Unix socket, the connection is forwarded over the secure channel, and a connection is made from the local machine to either an explicit destination specified by host port hostport, or local_socket, or, if no explicit destination was specified, ssh will act as a SOCKS 4/5 proxy and forward connections to the destinations requested by the remote SOCKS client.

Port forwardings can also be specified in the configuration file. Privileged ports can be forwarded only when logging in as root on the remote machine. IPv6 addresses can be specified by enclosing the address in square brackets.

By default, TCP listening sockets on the server will be bound to the loopback interface only. This may be overridden by specifying a bind_address. An empty bind_address, or the address *, indicates that the remote socket should listen on all interfaces. Specifying a remote bind_address will only succeed if the server's GatewayPorts option is enabled (see secshd.

If the port argument is 0, the listen port will be dynamically allocated on the server and reported to the client at run time. When used together with -O forward the allocated port will be printed to the standard output.

-S ctl_path 

Specifies the location of a control socket for connection sharing, or the string none to disable connection sharing. Refer to the description of ControlPath and ControlMaster for details.

-s 

May be used to request invocation of a subsystem on the remote system. Subsystems facilitate the use of SSH as a secure transport for other applications (e.g. sftp). The subsystem is specified as the remote command.

-t 

Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, for example, when implementing menu services. Multiple -t options force tty allocation, even if secsh has no local tty.

-T 

Disable pseudo-terminal allocation.

-v 

Verbose mode. Causes secsh to print debugging messages about its progress. This is helpful in debugging connection, authentication, and configuration problems. Multiple -v options increases the verbosity. Maximum is 3.

-W host:port 

Requests that standard input and output on the client be forwarded to host on port over the secure channel. Implies -N, -T, ExitOnForwardFailure and ClearAllForwardings, though these can be overridden in the configuration file or using -o command line options.

-x 

Disables X11 forwarding.

-X 

Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.

X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.

-Y 

Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

-y 

Writes log information to the application event log. By default, this information is sent to the standard error stream.

-4 

Forces secsh to use IPv4 addresses only.

-6 

Forces secsh to use IPv6 addresses only.


AUTHENTICATION

The OpenSSH SSH client supports SSH protocol 2.

The methods available for authentication are: GSSAPI-based authentication, host-based authentication, public key authentication, challenge-response authentication, and password authentication. Authentication methods are tried in the order specified above, though PreferredAuthentications can be used to change the default order.

Host-based authentication works as follows: If the machine the user logs in from is listed in $ROOTDIR/etc/hosts.equiv or $ROOTDIR/etc/shosts.equiv on the remote machine, and the user names are the same on both sides, or if the files ~/.rhosts or ~/.shosts exist in the user's home directory on the remote machine and contain a line containing the name of the client machine and the name of the user on that machine, the user is considered for login. Additionally, the server must be able to verify the client's host key (see the description of $ROOTDIR/etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts, below) for login to be permitted. This authentication method closes security holes due to IP spoofing, DNS spoofing, and routing spoofing. [Note to the administrator: $ROOTDIR/etc/hosts.equiv, ~/.rhosts, and the rlogin/rsh protocol in general, are inherently insecure and should be disabled if security is desired.]

Public key authentication works as follows: The scheme is based on public-key cryptography, using cryptosystems where encryption and decryption are done using separate keys, and it is unfeasible to derive the decryption key from the encryption key. The idea is that each user creates a public/private key pair for authentication purposes. The server knows the public key, and only the user knows the private key. ssh implements public key authentication protocol automatically, using one of the DSA, ECDSA, Ed25519 or RSA algorithms. The HISTORY section of ssl(8) contains a brief discussion of the DSA and RSA algorithms.

The file ~/.ssh/authorized_keys lists the public keys that are permitted for logging in. When the user logs in, the secsh program tells the server which key pair it would like to use for authentication. The client proves that it has access to the private key and the server checks that the corresponding public key is authorized to accept the account.

The server may inform the client of errors that prevented public key authentication from succeeding after authentication completes using a different method. These may be viewed by increasing the LogLevel to DEBUG or higher (e.g. by using the -v flag).

The user creates his/her key pair by running secsh-keygen. This stores the private key in ~/.ssh/id_dsa (DSA), ~/.ssh/id_ecdsa (ECDSA), ~/.ssh/id_ed25519 (Ed25519), or ~/.ssh/id_rsa (RSA) and stores the public key in ~/.ssh/id_dsa.pub (DSA), ~/.ssh/id_ecdsa.pub (ECDSA), ~/.ssh/id_ed25519.pub (Ed25519), or ~/.ssh/id_rsa.pub (RSA) in the user's home directory. The user should then copy the public key to ~/.ssh/authorized_keys in his/her home directory on the remote machine. The authorized_keys file corresponds to the conventional ~/.rhosts file, and has one key per line, though the lines can be very long. After this, the user can log in without giving the password.

A variation on public key authentication is available in the form of certificate authentication: instead of a set of public/private keys, signed certificates are used. This has the advantage that a single trusted certification authority can be used in place of many public/private keys. See the CERTIFICATES section of secsh-keygen for more information.

The most convenient way to use public key or certificate authentication may be with an authentication agent. See secsh-agent and (optionally) the AddKeysToAgent directive in secsh_config for more information.

Challenge-response authentication works as follows: The server sends an arbitrary "challenge" text, and prompts for a response. Examples of challenge-response authentication include BSD Authentication (see login.conf) and PAM (some non-OpenBSD systems).

Finally, if other authentication methods fail, secsh prompts the user for a password. The password is sent to the remote host for checking; however, since all communications are encrypted, the password cannot be seen by someone listening on the network.

secsh automatically maintains and checks a database containing identification for all hosts it has ever been used with. Host keys are stored in ~/.ssh/known_hosts in the user's home directory. Additionally, the file $ROOTDIR/etc/ssh/ssh_known_hosts is automatically checked for known hosts. Any new hosts are automatically added to the user's file. If a host's identification ever changes, secsh warns about this and disables password authentication to prevent server spoofing or man-in-the-middle attacks, which could otherwise be used to circumvent the encryption. The StrictHostKeyChecking option can be used to control logins to machines whose host key is not known or has changed.

When the user's identity has been accepted by the server, the server either executes the given command in a non-interactive session or, if no command has been specified, logs into the machine and gives the user a normal shell as an interactive session. All communication with the remote command or shell will be automatically encrypted.

If an interactive session is requested secsh by default will only request a pseudo-terminal (pty) for interactive sessions when the client has one. The flags -T and -t can be used to override this behaviour.

If a pseudo-terminal has been allocated the user may use the escape characters noted below.

If no pseudo-terminal has been allocated, the session is transparent and can be used to reliably transfer binary data. On most systems, setting the escape character to none will also make the session transparent even if a tty is used.

The session terminates when the command or shell on the remote machine exits and all X11 and TCP connections have been closed.


ESCAPE CHARACTERS

When a pseudo-terminal has been requested, secsh supports a number of functions through the use of an escape character.

A single tilde character can be sent as ~~ or by following the tilde by a character other than those described below. The escape character must always follow a newline to be interpreted as special. The escape character can be changed in configuration files using the EscapeChar configuration directive or on the command line by the -e option.

The supported escapes (assuming the default ~) are:

~. 

Disconnect

~^Z 

Background secsh

~# 

List forwarded connections

~& 

Background secsh at logout when waiting for forwarded connection / X11 sessions to terminate

~? 

Display a list of escape characters

~B 

Send a BREAK to the remote system (only useful for SSH protocol version 2 and if the peer supports it).

~C 

Open command line. Currently this allows the addition of port forwardings using the -L, -R and -D options (see above). It also allows the cancellation of existing port-forwardings with -KL[bind_address:]port for local, -KR[bind_address:]port for remote and -KD[bind_address:]port for dynamic port-forwardings. !command allows the user to execute a local command if the PermitLocalCommand option is enabled. Basic help is available, using the -h option.

~R 

Request rekeying of the connection (only useful for SSH protocol version 2 and if the peer supports it)

~V 

Decrease the verbosity (LogLevel) when errors are being written to stderr.

~v 

Increase the verbosity (LogLevel) when errors are being written to stderr.


TCP FORWARDING

Forwarding of arbitrary TCP connections over the secure channel can be specified either on the command line or in a configuration file. One possible application of TCP forwarding is a secure connection to a mail server; another is going through firewalls.

In the example below, we look at encrypting communication between an IRC client and server, even though the IRC server does not directly support encrypted communications. This works as follows: the user connects to the remote host using secsh, specifying a port to be used to forward connections to the remote server. After that it is possible to start the service which is to be encrypted on the client machine, connecting to the same local port, and secsh will encrypt and forward the connection.

The following example tunnels an IRC session from client machine \127.0.0.1 (localhost) to remote server server.example.com:

    $ ssh -f -L 1234:localhost:6667 server.example.com sleep 10
    $ irc -c '#users' -p 1234 pinky 127.0.0.1

This tunnels a connection to IRC server server.example.com, joining channel #users, nickname pinky, using port 1234. It doesn't matter which port is used, as long as it's greater than 1023 (remember, only root can open sockets on privileged ports) and doesn't conflict with any ports already in use. The connection is forwarded to port 6667 on the remote server, since that's the standard port for IRC services.

The -f option backgrounds secsh and the remote command sleep 10 is specified to allow an amount of time (10 seconds, in the example) to start the service which is to be tunnelled. If no connections are made within the time specified, secsh will exit.


X11 FORWARDING

If the ForwardX11 variable is set to yes (or see the description of the -X, -x, and -Y options above) and the user is using X11 (the DISPLAY environment variable is set), the connection to the X11 display is automatically forwarded to the remote side in such a way that any X11 programs started from the shell (or command) will go through the encrypted channel, and the connection to the real X server will be made from the local machine. The user should not manually set DISPLAY. Forwarding of X11 connections can be configured on the command line or in configuration files.

The DISPLAY value set by secsh will point to the server machine, but with a display number greater than zero. This is normal, and happens because ssh creates a proxy X server on the server machine for forwarding the connections over the encrypted channel.

secsh will also automatically set up Xauthority data on the server machine. For this purpose, it will generate a random authorization cookie, store it in Xauthority on the server, and verify that any forwarded connections carry this cookie and replace it by the real cookie when the connection is opened. The real authentication cookie is never sent to the server machine (and no cookies are sent in the plain).

If the ForwardAgent variable is set to yes (or see the description of the -A and -a options above) and the user is using an authentication agent, the connection to the agent is automatically forwarded to the remote side.


VERIFYING HOST KEYS

When connecting to a server for the first time, a fingerprint of the server's public key is presented to the user (unless the option StrictHostKeyChecking has been disabled). Fingerprints can be determined using secsh-keygen:

      $ secsh-keygen -l -f $ROOTDIR/etc/ssh/ssh_host_rsa_key

If the fingerprint is already known, it can be matched and the key can be accepted or rejected. If only legacy (MD5) fingerprints for the server are available, the secsh-keygen -E option may be used to downgrade the fingerprint algorithm to match.

Because of the difficulty of comparing host keys just by looking at fingerprint strings, there is also support to compare host keys visually, using random art. By setting the VisualHostKey option to yes, a small ASCII graphic gets displayed on every login to a server, no matter if the session itself is interactive or not. By learning the pattern a known server produces, a user can easily find out that the host key has changed when a completely different pattern is displayed. Because these patterns are not unambiguous however, a pattern that looks similar to the pattern remembered only gives a good probability that the host key is the same, not guaranteed proof.

To get a listing of the fingerprints along with their random art for all known hosts, the following command line can be used:

 $ secsh-keygen -lv -f ~/.ssh/known_hosts

If the fingerprint is unknown, an alternative method of verification is available: SSH fingerprints verified by DNS. An additional resource record (RR), SSHFP, is added to a zonefile and the connecting client is able to match the fingerprint with that of the key presented.

In this example, we are connecting a client to a server, host.example.com. The SSHFP resource records should first be added to the zonefile for host.example.com:

      $ secsh-keygen -r host.example.com.

The output lines will have to be added to the zonefile. To check that the zone is answering fingerprint queries:

      $ dig -t SSHFP host.example.com

Finally the client connects:

      $ ssh -o "VerifyHostKeyDNS ask" host.example.com
      [...]
      Matching host key fingerprint found in DNS.
      Are you sure you want to continue connecting (yes/no)?

See the VerifyHostKeyDNS option in ssh_config(5) for more information.


CONFIGURATION FILES

secsh obtains configuration data from the following sources in the following order: command line options, user's configuration in the Windows registry, and system-wide configuration (stored in the Windows registry and configured with the PTC MKS Toolkit control panel applet). For each parameter, the first obtained value will be used. The configuration files contain sections bracketed by Host specifications, and that section is only applied for hosts that match one of the patterns given in the specification. The matched host name is the one given on the command line.

Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.

The configuration file has the following format:

Empty lines and lines starting with # are comments.

Otherwise a line is of the format keyword arguments. Configuration options may be separated by whitespace or optional whitespace and exactly one =; the latter format is useful to avoid the need to quote whitespace when specifying configuration options using the secsh, scp, and sftp -o option.

The possible keywords and their meanings are as follows (note that the configuration files are case-sensitive):

AddKeysToAgent 

Specifies whether keys should be automatically added to a running secsh-agent. If this option is set to yes and a key is loaded from a file, the key and its passphrase are added to the agent with the default lifetime, as if by secsh-add. If this option is set to ask, secsh will require confirmation using the SSH_ASKPASS program before adding a key (see secsh-add for details). If this option is set to confirm, each use of the key must be confirmed, as if the -c option was specified to secsh-add. If this option is set to no, no keys are added to the agent. The argument must be yes, confirm, ask, or no (the default).

AddressFamily 

Specifies which address family to use when connecting. Valid arguments are any, inet (use IPv4 only), or inet6 (use IPv6 only).

BatchMode 

If set to yes, passphrase/password querying will be disabled. This option is useful in scripts and other batch jobs where you have no user to supply the password. The argument must be yes or no. The default is no.

BindAddress 

Specifies the interface to transmit from on machines with multiple interfaces or aliased addresses. Note that this option does not work if UsePrivilegedPort is set to yes.

CanonicalDomains 

When CanonicalizeHostname is enabled, this option specifies the list of domain suffixes in which to search for the specified destination host.

CanonicalizeFallbackLocal 

Specifies whether to fail with an error when hostname canonicalization fails. The default, yes, will attempt to look up the unqualified hostname using the system resolver's search rules. A value of no will cause secsh to fail instantly if CanonicalizeHostname is enabled and the target hostname cannot be found in any of the domains specified by CanonicalDomains.

CanonicalizeHostname 

Controls whether explicit hostname canonicalization is performed. The default, no, is not to perform any name rewriting and let the system resolver handle all hostname lookups. If set to yes then, for connections that do not use a ProxyCommand, secsh will attempt to canonicalize the hostname specified on the command line using the CanonicalDomains suffixes and CanonicalizePermittedCNAMEs rules. If CanonicalizeHostname is set to always, then canonicalization is applied to proxied connections too.

If this option is enabled and canonicalisation results in the target hostname changing, then the configuration files are processed again using the new target name to pick up any new configuration in matching Host stanzas.

CanonicalizeMaxDots 

Specifies the maximum number of dot characters in a hostname before canonicalization is disabled. The default, 1, allows a single dot (i.e. hostname.subdomain).

CanonicalizePermittedCNAMEs 

Specifies rules to determine whether CNAMEs should be followed when canonicalizing hostnames. The rules consist of one or more arguments of source_domain_list:target_domain_list, where source_domain_list is a pattern-list of domains that may follow CNAMEs in canonicalization, and target_domain_list is a pattern- list of domains that they may resolve to. For example, *.a.example.com:*.b.example.com,*.c.example.com will allow hostnames matching *.a.example.com to be canonicalized to names in the *.b.example.com or *.c.example.com domains.

CertificateFile 

Specifies a file from which the user's certificate is read. A corresponding private key must be provided separately in order to use this certificate either from an IdentityFile directive or -i flag to secsh, or via secsh-agent.

Arguments to CertificateFile may use the tilde syntax to refer to a user's home directory or the tokens described in the TOKENS section.

It is possible to have multiple certificate files specified in configuration files; these certificates will be tried in sequence. Multiple CertificateFile directives will add to the list of certificates used for authentication.

ChallengeResponseAuthentication 

Specifies whether to use challenge-response authentication. The argument to this keyword must be yes or no. The default is yes.

CheckHostIP 

If set to yes (the default), secsh will additionally check the host IP address in the known_hosts file. This allows it to detect if a host key changed due to DNS spoofing and will add addresses of destination hosts to ~/.ssh/known_hosts in the process, regardless of the setting of StrictHostKeyChecking. If the option is set to no, the check will not be executed.

Ciphers 

Specifies the ciphers allowed and their order of preference. Multiple ciphers must be comma-separated. If the specified value begins with a + character, then the specified ciphers will be appended to the default set instead of replacing them. If the specified value begins with a - character, then the specified ciphers (including wildcards) will be removed from the default set instead of replacing them.

3des-cbc,
aes128-cbc,
aes192-cbc,
aes256-cbc,
aes128-ctr,
aes192-ctr,
aes256-ctr,
aes128-gcm@openssh.com,
aes256-gcm@openssh.com,
chacha20-poly1305@openssh.com

The default is

chacha20-poly1305@openssh.com,
aes128-ctr,aes192-ctr,aes256-ctr,
aes128-gcm@openssh.com,aes256-gcm@openssh.com

The list of available ciphers may also be obtained using the -Q option of secsh.

ClearAllForwardings 

Specifies that all local, remote and dynamic port forwardings specified in the configuration files or on the command line be cleared. This option is primarily useful when used from the secsh command line to clear port forwardings set in configuration files, and is automatically set by scp and sftp. The argument must be yes or no. The default is no.

Compression 

Specifies whether to use compression. The argument must be yes or no. The default is no.

ConnectionAttempts 

Specifies the number of tries (one per second) to make before falling back to rsh or exiting. The argument must be an integer. This may be useful in scripts if the connection sometimes fails. The default is 1.

ConnectTimeout 

Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default system TCP timeout. This value is used only when the target is down or really unreachable, not when it refuses the connection.

ControlMaster 

Enables the sharing of multiple sessions over a single network connection. When set to yes, secsh will listen for connections on a control socket specified using the ControlPath argument. Additional sessions can connect to this socket using the same ControlPath with ControlMaster set to no (the default). These sessions will try to reuse the master instance's network connection rather than initiating new ones, but will fall back to connecting normally if the control socket does not exist, or is not listening.

Setting this to ask will cause ssh to listen for control connections, but require confirmation using secsh-askpass. If the ControlPath cannot be opened, ssh will continue without connecting to a master instance.

X11 and secsh-agent forwarding is supported over these multiplexed connections, however the display and agent forwarded will be the one belonging to the master connection i.e. it is not possible to forward multiple displays or agents.

Two additional options allow for opportunistic multiplexing: try to use a master connection but fall back to creating a new one if one does not already exist. These options are: auto and autoask. The latter requires confirmation like the ask option.

ControlPath 

Specify the path to the control socket used for connection sharing as described in the ControlMaster section above or the string none to disable connection sharing. Arguments to ControlPath may use the tilde syntax to refer to a user's home directory or the tokens described in the TOKENS section. It is recommended that any ControlPath used for opportunistic connection sharing include at least %h, %p, and %r (or alternatively %C) and be placed in a directory that is not writable by other users. This ensures that shared connections are uniquely identified.

ControlPersist 

When used in conjunction with ControlMaster, specifies that the master connection should remain open in the background (waiting for future client connections) after the initial client connection has been closed. If set to no, then the master connection will not be placed into the background, and will close as soon as the initial client connection is closed. If set to yes, then the master connection will remain in the background indefinitely (until killed or closed via a mechanism such as the secsh -O exit option). If set to a time in seconds, or a time in any of the formats documented in secshd, then the backgrounded master connection will automatically terminate after it has remained idle (with no client connections) for the specified time.

DynamicForward 

Specifies that a TCP/IP port on the local machine be forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine.

The argument must be [bind_address:]port. IPv6 addresses can be specified by enclosing addresses in square brackets. By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of localhost indicates that the listening port be bound for local use only, while an empty address or * indicates that the port should be available from all interfaces.

Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh(1) will act as a SOCKS server. Multiple forwardings may be specified, and additional forwardings can be given on the command line. Only the superuser can forward privileged ports.

EnableSSHKeysign 

Setting this option to yes in the global client configuration enables the use of the helper program secsh-keysign during host-based authentication. The argument must be yes or no (the default). This option should be placed in the non-host-specific section. See the secsh-keysign reference page for more information.

EscapeChar 

Sets the escape character (default: ~). The escape character can also be set on the command line. The argument should be a single character, ^ followed by a letter, or none to disable the escape character entirely (making the connection transparent for binary data).

ExitOnForwardFailure 

Specifies whether secsh should terminate the connection if it cannot set up all requested dynamic, tunnel, local, and remote port forwardings (e.g. if either end is unable to bind and listen on a specified port). Note that ExitOnForwardFailure does not apply to connections made over port forwardings and will not, for example, cause secsh to exit if TCP connections to the ultimate forwarding destination fail. The argument must be yes or no (the default).

ForwardAgent 

Specifies whether the connection to the authentication agent (if any) will be forwarded to the remote machine. The argument must be yes or no (the default).

ForwardX11 

Specifies whether X11 connections will be automatically redirected over the secure channel and DISPLAY set. The argument must be yes or no (the default).

ForwardX11Timeout 

Specify a timeout for untrusted X11 forwarding using the format described in the TIME FORMATS section of secshd. X11 connections received by secsh after this time will be refused. The default is to disable untrusted X11 forwarding after twenty minutes has elapsed.

ForwardX11Trusted 

When this option is set to yes, remote X11 clients have full access to the original X11 display.

When this option is set to no, remote X11 clients are considered untrusted and prevented from stealing or tampering with data belonging to trusted X11 clients. Furthermore, the xauth token used for the session are set to expire after 20 minutes. Remote clients are refused access after this time.

The default is no.

See the X11 SECURITY extension specification for full details on the restrictions imposed on untrusted clients.

GatewayPorts 

Specifies whether remote hosts are allowed to connect to local forwarded ports. By default, secsh binds local port forwardings to the loopback address. This prevents other remote hosts from connecting to forwarded ports. GatewayPorts can be used to specify that secsh should bind local port forwardings to the wildcard address, thus allowing remote hosts to connect to forwarded ports. The argument must be yes or no (the default).

GlobalKnownHostsFile 

Specifies a file to use for the host key database instead of $ROOTDIR/etc/ssh_known_hosts.

GSSAPIAuthentication 

Specifies whether user authentication based on GSSAPI is allowed. The default is no.

GSSAPIDelegateCredentials 

Forwards (delegates) credentials to the server. The default is no.

HashKnownHosts 

Indicates that secsh should hash host names and addresses when they are added to $USERPROFILE/.ssh/known_hosts. These hashed names may be used normally by secsh and secshd, but they do not reveal identifying information should the file's contents be disclosed. The default is no. Existing names and addresses in known hosts files are not converted automatically, but may be manually hashed using secsh-keygen.

HostbasedAuthentication 

Specifies whether to try rhosts based authentication with public key authentication. The argument must be yes or no (the default).

HostbasedKeyTypes 

Specifies the key types that will be used for hostbased authentication as a comma-separated list of patterns. Alternately if the specified value begins with a + character, then the specified key types will be appended to the default set instead of replacing them. If the specified value begins with a - character, then the specified key types (including wildcards) will be removed from the default set instead of replacing them. The default for this option is:

   ecdsa-sha2-nistp256-cert-v01@openssh.com,
   ecdsa-sha2-nistp384-cert-v01@openssh.com,
   ecdsa-sha2-nistp521-cert-v01@openssh.com,
   ssh-ed25519-cert-v01@openssh.com,
   rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
   ssh-rsa-cert-v01@openssh.com,
   ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
   ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa

The -Q option of secsh may be used to list supported key types.

HostKeyAlgorithms 

Specifies the host key algorithms that the client wants to use in order of preference. Alternately if the specified value begins with a + character, then the specified key types will be appended to the default set instead of replacing them. If the specified value begins with a - character, then the specified key types (including wildcards) will be removed from the default set instead of replacing them. The default for this option is:

   ecdsa-sha2-nistp256-cert-v01@openssh.com,
   ecdsa-sha2-nistp384-cert-v01@openssh.com,
   ecdsa-sha2-nistp521-cert-v01@openssh.com,
   ssh-ed25519-cert-v01@openssh.com,
   rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
   ssh-rsa-cert-v01@openssh.com,
   ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
   ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa

If hostkeys are known for the destination host then this default is modified to prefer their algorithms.

The list of available key types may also be obtained using secsh -Q key.

HostKeyAlias 

Specifies an alias that should be used instead of the real host name when looking up or saving the host key in the host key database files and when validating host certificates. This option is useful for tunneling SSH connections or for multiple servers running on a single host.

HostName 

Specifies the real host name to log into. This can be used to specify nicknames or abbreviations for hosts. Arguments to HostName accept the tokens described in the TOKENS section. Numeric IP addresses are also permitted (both on the command line and in HostName specifications). The default is the name given on the command line.

IdentitiesOnly 

Specifies that secsh should only use the authentication identity and certificate files explicitly configured in the secsh_config files or passed on the secsh command-line, even if secsh-agent offers more identities. The argument to this keyword must be yes or no (the default). This option is intended for situations where secsh-agent offers many different identities.

IdentityAgent 

Specifies the UNIX-domain socket used to communicate with the authentication agent.

This option overrides the SSH_AUTH_SOCK environment variable and can be used to select a specific agent. Setting the socket name to none disables the use of an authentication agent. If the string "SSH_AUTH_SOCK" is specified, the location of the socket will be read from the SSH_AUTH_SOCK environment variable.

Arguments to IdentityAgent may use the tilde syntax to refer to a user's home directory or the tokens described in the TOKENS section.

IdentityFile 

Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication identity is read. The default is ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/id_rsa. Additionally, any identities represented by the authentication agent will be used for authentication unless IdentitiesOnly is set. If no certificates have been explicitly specified by CertificateFile, secsh will try to load certificate information from the filename obtained by appending -cert.pub to the path of a specified IdentityFile.

Arguments to IdentityFile may use the tilde syntax to refer to a user's home directory or the tokens described in the TOKENS section.

It is possible to have multiple identity files specified in configuration files; all these identities will be tried in sequence. Multiple IdentityFile directives will add to the list of identities tried (this behaviour differs from that of other configuration directives).

IdentityFile may be used in conjunction with IdentitiesOnly to select which identities in an agent are offered during authentication. IdentityFile may also be used in conjunction with CertificateFile in order to provide any certificate also needed for authentication with the identity.

IgnoreUnknown 

Specifies a pattern-list of unknown options to be ignored if they are encountered in configuration parsing. This may be used to suppress errors if the configuration contains options that are unrecognised by secsh.

IPQoS 

Specifies the IPv4 type-of-service or DSCP class for connections. Accepted values are af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef, lowdelay, throughput, reliability, a numeric value, or none to use the operating system default. This option may take one or two arguments, separated by whitespace. If one argument is specified, it is used as the packet class unconditionally. If two values are specified, the first is automatically selected for interactive sessions and the second for non-interactive sessions. The default is af21 (Low-Latency Data) for interactive sessions and cs1 (Lower Effort) for non-interactive sessions.

KbdInteractiveAuthentication 

Specifies wheter to use keyboard-interactive authentication. The argument to this keyword must be yes (the default) or no.

KbdInteractiveDevices 

Specifies the list of methods to use in keyboard-interactive authentication. Multiple method names must be comma-separated. The default is to use the server specified list. The methods available vary depending on what the server supports. For an OpenSSH server, it may be zero or more of: bsdauth and pam.

KexAlgorithms 

Specifies the available KEX (Key Exchange) algorithms. Multiple algorithms must be comma-separated. Alternately if the specified value begins with a + character, then the specified methods will be appended to the default set instead of replacing them. If the specified value begins with a - character, then the specified methods (including wildcards) will be removed from the default set instead of replacing them. The default is:

      curve25519-sha256,curve25519-sha256@libssh.org,
      ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
      diffie-hellman-group-exchange-sha256,
      diffie-hellman-group16-sha512,
      diffie-hellman-group18-sha512,
      diffie-hellman-group-exchange-sha1,
      diffie-hellman-group14-sha256,
      diffie-hellman-group14-sha1

The list of available key exchange algorithms may also be obtained using "ssh -Q kex".

LocalCommand 

Specifies a command to execute on the local machine after successfully connecting to the server. The command string extends to the end of the line, and is executed with the user's shell. Arguments to LocalCommand accept the tokens described in the TOKENS section.

The command is run synchronously and does not have access to the session of the secsh that spawned it. It should not be used for interactive commands.

This directive is ignored unless PermitLocalCommand has been enabled.

LocalForward 

Specifies that a TCP port on the local machine be forwarded over the secure channel to the specified host and port from the remote machine. The first argument must be [bind_address:]port and the second argument must be host:hostport. IPv6 addresses can be specified by enclosing addresses in square brackets. Multiple forwardings may be specified, and additional forwardings can be given on the command line. By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of localhost indicates that the listening port be bound for local use only, while an empty address or * indicates that the port should be available from all interfaces.

LogLevel 

Gives the verbosity level that is used when logging messages from secsh. The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG. The default is INFO.

MACs 

Specifies the MAC (message authentication code) algorithms in order of preference. The MAC algorithm is used for data integrity protection. Multiple algorithms must be comma- separated. If the specified value begins with a + character, then the specified algorithms will be appended to the default set instead of replacing them. If the specified value begins with a - character, then the specified algorithms (including wildcards) will be removed from the default set instead of replacing them.

The algorithms that contain -etm calculate the MAC after encryption (encrypt-then-mac). These are considered safer and their use recommended.

The default is:

      umac-64-etm@openssh.com,umac-128-etm@openssh.com,
      hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
      hmac-sha1-etm@openssh.com,
      umac-64@openssh.com,umac-128@openssh.com,
      hmac-sha2-256,hmac-sha2-512,hmac-sha1

The list of available MAC algorithms may also be obtained using ssh -Q mac.

NoHostAuthenticationForLocalhost 

Disable host authentication for localhost (loopback addresses). The argument to this keyword must be yes or no (the default).

NumberOfPasswordPrompts 

Specifies the number of password prompts before giving up. The argument to this keyword must be an integer. Default is 3.

PasswordAuthentication 

Specifies whether to use password authentication. The argument to this keyword must be yes (the default) or no.

PermitLocalCommand 

Allows local command execution via the LocalCommand option or using the !command sequence in secsh. The argument must be yes or no (the default).

Port 

Specifies the port number to connect on the remote host. Default is 22.

PreferredAuthentications 

Specifies the order in which the client should try authentication methods. This allows a client to prefer one method (e.g. keyboard-interactive) over another method (e.g. password). The default is:

      gssapi-with-mic,hostbased,publickey,
      keyboard-interactive,password
ProxyCommand 

Specifies the command to use to connect to the server. The command string extends to the end of the line, and is executed using the user's shell exec directive to avoid a lingering shell process.

Arguments to ProxyCommand accept the tokens described in the TOKENS section. The command can be basically anything, and should read from its standard input and write to its standard output. It should eventually connect an secshd server running on some machine, or execute sshd -i somewhere. Host key management will be done using the HostName of the host being connected (defaulting to the name typed by the user). Setting the command to none disables this option entirely. Note that CheckHostIP is not available for connects with a proxy command.

This directive is useful in conjunction with nc(1) and its proxy support. For example, the following directive would connect via an HTTP proxy at 192.0.2.0:

   ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
ProxyUseFdpass 

Specifies that ProxyCommand will pass a connected file descriptor back to secsh instead of continuing to execute and pass data. The default is no.

PubkeyAcceptedKeyTypes 

Specifies the key types that will be used for public key authentication as a comma-separated list of patterns. Alternately if the specified value begins with a + character, then the key types after it will be appended to the default instead of replacing it. If the specified value begins with a - character, then the specified key types (including wildcards) will be removed from the default set instead of replacing them. The default for this option is:

   ecdsa-sha2-nistp256-cert-v01@openssh.com,
   ecdsa-sha2-nistp384-cert-v01@openssh.com,
   ecdsa-sha2-nistp521-cert-v01@openssh.com,
   ssh-ed25519-cert-v01@openssh.com,
   rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
   ssh-rsa-cert-v01@openssh.com,
   ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
   ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa

The list of available key types may also be obtained using ssh -Q key.

PubkeyAuthentication 

Specifies whether to try public key authentication. The argument to this keyword must be yes (the default) or no.

RekeyLimit 

Specifies the maximum amount of data that may be transmitted before the session key is renegotiated, optionally followed a maximum amount of time that may pass before the session key is renegotiated. The first argument is specified in bytes and may have a suffix of K, M, or G to indicate Kilobytes, Megabytes, or Gigabytes, respectively. The default is between 1G and 4G, depending on the cipher. The optional second value is specified in seconds and may use any of the units documented in the TIME FORMATS section of secshd. The default value for RekeyLimit is default none, which means that rekeying is performed after the cipher's default amount of data has been sent or received and no time based rekeying is done.

RemoteCommand 

Specifies a command to execute on the remote machine after successfully connecting to the server. The command string extends to the end of the line, and is executed with the user's shell. Arguments to RemoteCommand accept the tokens described in the TOKENS section.

RemoteForward 

Specifies that a TCP port on the remote machine be forwarded over the secure channel. The remote port may either be forwarded to a specified host and port from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote client to connect to arbitrary destinations from the local machine. The first argument must be [bind_address:]port. If forwarding to a specific destination then the second argument must be host:hostport, otherwise if no destination argument is specified then the remote forwarding will be established as a SOCKS proxy.

IPv6 addresses can be specified by enclosing addresses in square brackets. Multiple forwardings may be specified, and additional forwardings can be given on the command line. Privileged ports can be forwarded only when logging in as root on the remote machine.

If the port argument is 0, the listen port will be dynamically allocated on the server and reported to the client at run time.

If the bind_address is not specified, the default is to only bind to loopback addresses. If the bind_address is * or an empty string, then the forwarding is requested to listen on all interfaces. Specifying a remote bind_address will only succeed if the server's GatewayPorts option is enabled (see secshd.

RequestTTY 

Specifies whether to request a pseudo-tty for the session. The argument may be one of: no (never request a TTY), yes (always request a TTY when standard input is a TTY), force (always request a TTY) or auto (request a TTY when opening a login session). This option mirrors the -t and -T flags for secsh.

RevokedHostKeys 

Specifies revoked host public keys. Keys listed in this file will be refused for host authentication. Note that if this file does not exist or is not readable, then host authentication will be refused for all hosts. Keys may be specified as a text file, listing one public key per line, or as an OpenSSH Key Revocation List (KRL) as generated by secsh-keygen. For more information on KRLs, see the KEY REVOCATION LISTS section in secsh-keygen.

SendEnv 

Specifies what variables from the local environment should be sent to the server. The server must also support it, and the server must be configured to accept these environment variables. Note that the TERM environment variable is always sent whenever a pseudo-terminal is requested as it is required by the protocol. Refer to AcceptEnv in secshd for how to configure the server. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives.

See PATTERNS for more information on patterns.

It is possible to clear previously set SendEnv variable names by prefixing patterns with -. The default is not to send any environment variables.

ServerAliveCountMax 

Sets the number of server alive messages (see below) which may be sent without secsh receiving any messages back from the server. When this threshold is reached while server alive messages are being sent, secsh disconnects from the server, terminating the session. The use of server alive messages is very different from TCPKeepAlive (below). The server alive messages are sent through the encrypted channel and therefore are not spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The server alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive. The default value is 3. If, for example, ServerAliveInterval (see below) is set to 15 and ServerAliveCountMax is left at the default, and the server becomes unresponsive, secsh disconnects after approximately 45 seconds.

ServerAliveInterval 

Sets a timeout interval in seconds after which if no data has been received from the server, secsh sends a message through the encrypted channel to request a response from the server. The default is 0, inidicating that these messages are not sent to the server.

SetEnv 

Directly specify one or more environment variables and their contents to be sent to the server. Similarly to SendEnv, the server must be prepared to accept the environment variable.

SmartcardDevice 

Specifies which smartcard device to use. The argument to this keyword is the device secsh should use to communicate with a smartcard used for storing the user's private RSA key. By default, no device is specified and smartcard support is not activated.

StreamLocalBindMask 

Sets the octal file creation mode mask (umask) used when creating a Unix-domain socket file for local or remote port forwarding. This option is only used for port forwarding to a Unix-domain socket file.

The default value is 0177, which creates a Unix-domain socket file that is readable and writable only by the owner. Note that not all operating systems honor the file mode on Unix-domain socket files.

StreamLocalBindUnlink 

Specifies whether to remove an existing Unix-domain socket file for local or remote port forwarding before creating a new one. If the socket file already exists and StreamLocalBindUnlink is not enabled, ssh will be unable to forward the port to the Unix- domain socket file. This option is only used for port forwarding to a Unix-domain socket file.

The argument must be yes or no (the default).

StrictHostKeyChecking 

If this flag is set to yes, secsh will never automatically add host keys to the ~/.ssh/known_hosts file, and refuses to connect to hosts whose host key has changed. This provides maximum protection against man-in-the-middle (MITM) attacks, though it can be annoying when the $ROOTDIR/etc/ssh/ssh_known_hosts file is poorly maintained or when connections to new hosts are frequently made. This option forces the user to manually add all new hosts.

If this flag is set to accept-new then secsh will automatically add new host keys to the user known hosts files, but will not permit connections to hosts with changed host keys. If this flag is set to no or off, secsh will automatically add new host keys to the user known hosts files and allow connections to hosts with changed hostkeys to proceed, subject to some restrictions. If this flag is set to ask (the default), new host keys will be added to the user known host files only after the user has confirmed that is what they really want to do, and secsh will refuse to connect to hosts whose host key has changed. The host keys of known hosts will be verified automatically in all cases.

TCPKeepAlive 

Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying.

The default is yes (to send TCP keepalive messages), and the client will notice if the network goes down or the remote host dies. This is important in scripts, and many users want it too.

To disable TCP keepalive messages, the value should be set to no. See also ServerAliveInterval for protocol-level keepalives.

UpdateHostKeys 

Specifies whether secsh should accept notifications of additional hostkeys from the server sent after authentication has completed and add them to UserKnownHostsFile. The argument must be yes, no (the default) or ask. Enabling this option allows learning alternate hostkeys for a server and supports graceful key rotation by allowing a server to send replacement public keys before old ones are removed. Additional hostkeys are only accepted if the key used to authenticate the host was already trusted or explicitly accepted by the user. If UpdateHostKeys is set to ask, then the user is asked to confirm the modifications to the known_hosts file. Confirmation is currently incompatible with ControlPersist, and will be disabled if it is enabled.

Presently, only secshd from OpenSSH 6.8 and greater support the hostkeys@openssh.com protocol extension used to inform the client of all the server's hostkeys.

User 

Specifies the user to log in as. This can be useful when you have a different user name on different machines. This saves the trouble of having to remember to give the user name on the command line.

UserKnownHostsFile 

Specifies a file to use for the user host key database instead of $USERPROFILE/.ssh/known_hosts.

VerifyHostKeyDNS 

Specifies whether to verify the remote key using DNS and SSHFP resource records. If this option is set to yes, the client will implicitly trust keys that match a secure fingerprint from DNS. Insecure fingerprints will be handled as if this option was set to ask. If this option is set to ask, information on fingerprint match will be displayed, but the user will still need to confirm new host keys according to the StrictHostKeyChecking option. The default is no.

See also VERIFYING HOST KEYS in secsh.

VisualHostKey 

When this flag is set to yes, an ASCII art representation of the remote host key fingerprint is printed in addition to the fingerprint string at login and for unknown host keys. If this flag is set to no, no fingerprint strings are printed at login and only the fingerprint string are printed for unknown host keys. The default is no.

XAuthLocation 

Specifies the location of the xauth program. The default is /usr/X11R6/bin/xauth.


ENVIRONMENT VARIABLES

secsh will normally set the following environment variables:

DISPLAY 

The DISPLAY variable indicates the location of the X11 server. It is automatically set by secsh to point to a value of the form hostname:n where hostname indicates the host where the shell runs, and n is an integer >= 1. secsh uses this special value to forward X11 connections over the secure channel. The user should normally not set DISPLAY explicitly, as that will render the X11 connection insecure (and will require the user to manually copy any required authorization cookies).

HOME 

Is set to the path of the user's home directory.

LOGNAME 

Is a synonym for USER; is set for compatibility with systems that use this variable.

MAIL 

Is set to the path of the user's mailbox.

PATH 

Is set to the default PATH, as specified when compiling secsh.

SSH_ASKPASS 

If secsh needs a passphrase, it reads the passphrase from the current terminal if it was run from a terminal. If secsh does not have a terminal associated with it but DISPLAY and SSH_ASKPASS are set, it executes the program specified by SSH_ASKPASS and open an X11 window to read the passphrase. This is particularly useful when calling secsh from a .Xsession or related script. (Note that on some machines it may be necessary to redirect the input from /dev/null to make this work.)

SSH_AUTH_SOCK 

Identifies the path of a unix-domain socket used to communicate with the agent.

SSH_CONNECTION 

Identifies the client and server ends of the connection. The variable contains four space-separated values: client ip-address, client port number, server ip-address, and server port number.

SSH_ORIGINAL_COMMAND 

Contains the original command line if a forced command is executed. It can be used to extract the original arguments.

SSH_TTY 

Is set to the name of the tty (path to the device) associated with the current shell or command. If the current session has no tty, this variable is not set.

TZ 

Is set to indicate the present timezone if it was set when the daemon was started (that is, the daemon passes the value on to new connections).

SSH_USER_AUTH 

Optionally set by secshd, this variable may contain a pathname to a file that lists the authentication methods successfully used when the session was established, including any public keys that were used.

USER 

Is set to the name of the user logging in.

USERPROFILE 

Is set to the location of the user's Windows NT/2000/XP profile. In the user's profile is a roaming profile, this will be saved and restored as the user logs in and out of machines within the domain.

Additionally, secsh reads $HOME/.ssh/environment, and adds lines of the format VARNAME=value to the environment.


PATTERNS

A pattern consists of zero or more non-whitespace characters, * (a wildcard that matches zero or more characters), or ? (a wildcard that matches exactly one character). For example, to specify a set of declarations for any host in the .co.uk set of domains, the following pattern could be used:

           Host *.co.uk

The following pattern would match any host in the 192.168.0.[0-9] network range:

           Host 192.168.0.?

A pattern-list is a comma-separated list of patterns. Patterns within pattern-lists may be negated by preceding them with an exclamation mark (!!). For example, to allow a key to be used from anywhere within an organization except from the dialup pool, the following entry (in authorized_keys) could be used:

           from="!*.dialup.example.com,*.example.com"

Note that a negated match will never produce a positive result by itself. For example, attempting to match "host3" against the following pattern- list will fail:

           from="!host1,!host2"

The solution here is to include a term that will yield a positive match, such as a wildcard:

           from="!host1,!host2,*"

TOKENS

Arguments to some keywords can make use of tokens, which are expanded at runtime:

           %%    A literal %.
           %C    Hash of %l%h%p%r.
           %d    Local user's home directory.
           %h    The remote hostname.
           %i    The local user ID.
           %L    The local hostname.
           %l    The local hostname, including the domain name.
           %n    The original remote hostname, as given on the command line.
           %p    The remote port.
           %r    The remote username.
           %u    The local username.

Match exec accepts the tokens %%, %h, %i, %L, %l, %n, %p, %r, and %u.

CertificateFile accepts the tokens %%, %d, %h, %i, %l, %r, and %u.

ControlPath accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.

HostName accepts the tokens %% and %h.

IdentityAgent and IdentityFile accept the tokens %%, %d, %h, %i, %l, %r, and %u.

LocalCommand accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, %T, and %u.

ProxyCommand accepts the tokens %%, %h, %p, and %r.

RemoteCommand accepts the tokens %%, %C, %d, %h, %i, %l, %n, %p, %r, and %u.


FILES

$USERPROFILE/.ssh/known_hosts 

Records host keys for all hosts the user has logged into that are not in $ROOTDIR/etc/ssh_known_hosts. See secshd.

$USERPROFILE/.ssh/id_dsa 
$USERPROFILE/.ssh/id_ecdsa 
$USERPROFILE/.ssh/id_ed25519 
$USERPROFILE/.ssh/id_rsa 

Contains the private key for authentication. These files contain sensitive data and should be readable by the user but not accessible by others (read/write/execute). secsh will simply ignore a private key file if it is accessible by others. It is possible to specify a passphrase when generating the key which will be used to encrypt the sensitive part of this file using AES-128.

$USERPROFILE/.ssh/id_dsa.pub 
$USERPROFILE/.ssh/id_ecdsa.pub 
$USERPROFILE/.ssh/id_ed25519.pub 
$USERPROFILE/.ssh/id_rsa.pub 

Contains the public key for authentication (public part of the identity file in human-readable form). The contents of the $USERPROFILE/.ssh/id_dsa.pub, $USERPROFILE/.ssh/id_ecdsa.pub, $USERPROFILE/.ssh/id_ed25519.pub, and $USERPROFILE/.ssh/id_rsa.pub file should be added to ~/.ssh/authorized_keys on all machines where the user wishes to log in using protocol version 2 DSA/RSA authentication. These files are not sensitive and can (but need not) be readable by anyone. These files are never used automatically and are not necessary; they are only provided for the convenience of the user.

~/.ssh/authorized_keys 

Lists the public keys (RSA/DSA/ECDSA/Ed25519) that can be used for logging in as this user. The format of this file is described in the secshd reference page. In the simplest form the format is the same as the .pub identity files (that is, each line contains the number of bits in modulus, public exponent, modulus, and comment fields, separated by spaces). This file is not highly sensitive, but the recommended permissions are read/write for the user, and not writable by others.

$ROOTDIR/etc/ssh_known_hosts 

Systemwide list of known host keys. This file should be prepared by the system administrator to contain the public host keys of all machines in the organization. This file should be world-readable. This file contains public keys, one per line, in the following format (fields separated by spaces): system name, public key, and optional comment field. When different names are used for the same machine, all such names should be listed, separated by commas. The format is described on the secshd reference page.

The canonical system name (as returned by name servers) is used by secshd to verify the client host when logging in; other names are needed because secsh does not convert the user-supplied name to a canonical name before checking the key, because someone with access to the name servers would then be able to fool host authentication.

HKEY_LOCAL_MACHINE/Software/Mortice Kern Systems/etc/ssh_config 

System-wide configuration. This provides defaults for those values that are not specified in the user's configuration file, and for those users who do not have a configuration file. The values here are normally configured from the PTC MKS Toolkit control panel applet.

$ROOTDIR/etc/ssh_host_dsa_key 
$ROOTDIR/etc/ssh_host_ecdsa_key 
$ROOTDIR/etc/ssh_host_ed25519_key 
$ROOTDIR/etc/ssh_host_rsa_key 

These files contain the private parts of the host keys and are used for HostbasedAuthentication. Since they are readable only by root, secsh must be setuid root if these authentication methods are desired.

~/.rhosts 

This file is used in .rhosts authentication to list the host/user pairs that are permitted to log in. (Note that this file is also used by rlogin and rsh, which makes using this file insecure.) Each line of the file contains a host name (in the canonical form returned by name servers), and then a user name on that host, separated by a space. On some machines this file may need to be world-readable if the user's home directory is on a NFS partition, because secshd reads it as root. Additionally, this file must be owned by the user, and must not have write permissions for anyone else. The recommended permission for most machines is read/write for the user, and not accessible by others.

Note that by default secshd will be installed so that it requires successful RSA host authentication before permitting .rhosts authentication. If the server machine does not have the client's host key in $ROOTDIR/etc/ssh_known_hosts, you can store it in ~/.ssh/known_hosts. The easiest way to do this is to connect back to the client from the server machine using secsh; this will automatically add the host key to $USERPROFILE/.ssh/known_hosts.

~/.shosts 

This file is used exactly the same way as .rhosts. The purpose for having this file is to be able to use rhosts authentication with secsh without permitting login with rlogin or rsh

$ROOTDIR/etc/hosts.equiv 

This file is used during .rhosts authentication. It contains canonical hosts names, one per line (the full format is described on the secshd reference page). If the client host is found in this file, login is automatically permitted provided client and server user names are the same. Additionally, successful RSA host authentication is normally required. This file should only be writable by root.

$ROOTDIR/etc/shosts.equiv 

This file is processed exactly as $ROOTDIR/etc/hosts.equiv. This file may be useful to permit logins using secsh but not using rsh/rlogin.

$ROOTDIR/etc/sshrc 

Commands in this file are executed by secsh when the user logs in just before the user's shell (or command) is started. See the secshd reference page for more information.

~/.ssh/rc 

Commands in this file are executed by secsh when the user logs in just before the user's shell (or command) is started. See the secshd reference page for more information.

~/.ssh/environment 

Contains additional definitions for environment variables, see section ENVIRONMENT_VARIABLES above.


AUTHORS

OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0.


PORTABILITY

All UNIX systems. Windows 7. Windows Server 2008 R2. Windows 8. Windows Server 2012. Windows 10. Windows Server 2016. Windows Server 2019.


NOTES

When you are using the MKS secure shell client on a Windows NT machine, the default user name will be of the form DOMAINNAME\username. Should you be connecting to the secure shell server on another Windows machine, this may well be exactly what you want. In the event that you are connecting to a UNIX machine, you must specify the UNIX username with the -l option. In the event that this is burdensome, you can create a host pattern for * on the Secure Shell Client tab of the PTC MKS Toolkit control panel applet, and in this pattern, set the user name to whatever user name you desire.

The secsh utility, by default, loads keys from the $USERPROFILE directory on 7/2008R2/8/2012/10/2016/2019 platforms instead of ~/. This is done because the ~/ directory might not be available for the case of a domain machine that cannot contact a domain controller. Note that the secure shell service continues to use the ~/.ssh directory to store configuration files. In particular, note that there are effectively two known_hosts files: one under $USERPROFILE/.ssh/known_hosts, and a second one under ~/.ssh/known_hosts. There is no guarantee that the directory to which the USERPROFILE environment variable points is on an NTFS partition, and thus there is no guarantee that the keys in this location can be properly secured.

Using the secure shell client in a console window where the screen buffer width is larger than the window (that is, the console window has a horizontal scrollbar) does not work well. It is recommended that the secure shell client be used from console windows where these two widths are the same. This limitation may be lifted in a future release.

Password prompting using the program specified in the SSH_ASKPASS environment variable does not work. The application creates a console window in which you are prompted for the password. This will be corrected in a future release.

To use X11 forwarding, you must have an X server running on your client machine.

When you are not using Kerberos authentication (GSSAPI), to enable passwordless logon to machines running the PTC MKS Toolkit version of secshd on a Windows NT machine, you must enable your account for rhosts access. This can be done with the rsetup utility or from the PTC MKS Toolkit control panel applet. There is no requirement that the rhosts or rshd service be running. The only requirement is that you enable your account. In the event that your password expires, the passwordless authentication fails and you are prompted for a password.

To use Kerberos authentication, see the PTC MKS Toolkit Connectivity Solutions Guide for more information about the capabilities and limitations of Kerberos with secure shell.

When connecting to secshd, you may find that neither the backspace or delete key work correctly to erase characters. You can correct this by using either:

stty erase ^H

or

stty erase ^?

to set the erase character to either backspace or delete, respectively.


AVAILABILITY

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
rlogin, rsh, scp, secsh-add, secsh-agent, secshd, secsh-keygen, secsh-keysign, sftp, stty

PTC MKS Toolkit Connectivity Solutions Guide

MKS Secure Shell feature overview

T. Ylonen, T. Kivinen, M. Saarinen, T. Rinne, and S. Lehtinen, SSH Protocol Architecture, draft-ietf-secsh-architecture-09.txt, July 2001, work in progress material.


PTC MKS Toolkit 10.2 Documentation Build 28.