📄 ssh.1
字号:
from the local machine.The user should not manually set.Ev DISPLAY .Forwarding of X11 connections can beconfigured on the command line or in configuration files..PpThe.Ev DISPLAYvalue set by.Nmwill point to the server machine, but with a display number greaterthan zero.This is normal, and happens because.Nmcreates a.Dq proxyX server on the server machine for forwarding theconnections over the encrypted channel..Pp.Nmwill 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 forwardedconnections carry this cookie and replace it by the real cookie whenthe connection is opened.The real authentication cookie is neversent to the server machine (and no cookies are sent in the plain)..PpIf the.Cm ForwardAgentvariable is set to.Dq yes(or, see the description of the.Fl Aand.Fl aoptions described later) andthe user is using an authentication agent, the connection to the agentis automatically forwarded to the remote side..PpForwarding of arbitrary TCP/IP connections over the secure channel canbe specified either on the command line or in a configuration file.One possible application of TCP/IP forwarding is a secure connection to anelectronic purse; another is going through firewalls..Pp.Ss Server authentication.Pp.Nmautomatically maintains and checks a database containingidentifications for all hosts it has ever been used with.Host keys are stored in.Pa $HOME/.ssh/known_hostsin the user's home directory.Additionally, the file.Pa /etc/ssh/ssh_known_hostsis automatically checked for known hosts.Any new hosts are automatically added to the user's file.If a host's identificationever changes,.Nmwarns about this and disables password authentication to prevent atrojan horse from getting the user's password.Another purpose ofthis mechanism is to prevent man-in-the-middle attacks which couldotherwise be used to circumvent the encryption.The.Cm StrictHostKeyCheckingoption can be used to prevent logins to machines whosehost key is not known or has changed..PpThe options are as follows:.Bl -tag -width Ds.It Fl aDisables forwarding of the authentication agent connection..It Fl AEnables forwarding of the authentication agent connection.This can also be specified on a per-host basis in a configuration file..PpAgent 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 toauthenticate using the identities loaded into the agent..It Fl b Ar bind_addressSpecify the interface to transmit from on machines with multipleinterfaces or aliased addresses..It Fl c Ar blowfish|3des|desSelects the cipher to use for encrypting the session..Ar 3desis used by default.It is believed to be secure..Ar 3des(triple-des) is an encrypt-decrypt-encrypt triple with three different keys..Ar blowfishis a fast block cipher, it appears very secure and is much faster than.Ar 3des ..Ar desis only supported in the.Nmclient for interoperability with legacy protocol 1 implementationsthat do not support the.Ar 3descipher.Its use is strongly discouraged due to cryptographic weaknesses..It Fl c Ar cipher_specAdditionally, for protocol version 2 a comma-separated list of ciphers canbe specified in order of preference.See.Cm Ciphersfor more information..It Fl e Ar ch|^ch|noneSets the escape character for sessions with a pty (default:.Ql ~ ) .The escape character is only recognized at the beginning of a line.The escape character followed by a dot.Pq Ql \&.closes the connection, followedby control-Z suspends the connection, and followed by itself sends theescape character once.Setting the character to.Dq nonedisables any escapes and makes the session fully transparent..It Fl fRequests.Nmto go to background just before command execution.This is useful if.Nmis going to ask for passwords or passphrases, but the userwants it in the background.This implies.Fl n .The recommended way to start X11 programs at a remote site is withsomething like.Ic ssh -f host xterm ..It Fl gAllows remote hosts to connect to local forwarded ports..It Fl i Ar identity_fileSelects a file from which the identity (private key) forRSA or DSA authentication is read.The default is.Pa $HOME/.ssh/identityfor protocol version 1, and.Pa $HOME/.ssh/id_rsaand.Pa $HOME/.ssh/id_dsafor protocol version 2.Identity files may also be specified ona per-host basis in the configuration file.It is possible to have multiple.Fl ioptions (and multiple identities specified inconfiguration files)..It Fl I Ar smartcard_deviceSpecifies which smartcard device to use. The argument isthe device.Nmshould use to communicate with a smartcard used for storing the user'sprivate RSA key..It Fl kDisables forwarding of Kerberos tickets and AFS tokens.This may also be specified on a per-host basis in the configuration file..It Fl l Ar login_nameSpecifies the user to log in as on the remote machine.This also may be specified on a per-host basis in the configuration file..It Fl m Ar mac_specAdditionally, for protocol version 2 a comma-separated list of MAC(message authentication code) algorithms canbe specified in order of preference.See the.Cm MACskeyword for more information..It Fl nRedirects stdin from.Pa /dev/null(actually, prevents reading from stdin).This must be used when.Nmis run in the background.A common trick is to use this to run X11 programs on a remote machine.For example,.Ic ssh -n shadows.cs.hut.fi emacs &will start an emacs on shadows.cs.hut.fi, and the X11connection will be automatically forwarded over an encrypted channel.The.Nmprogram will be put in the background.(This does not work if.Nmneeds to ask for a password or passphrase; see also the.Fl foption.).It Fl NDo not execute a remote command.This is useful for just forwarding ports(protocol version 2 only)..It Fl o Ar optionCan be used to give options in the format used in the configuration file.This is useful for specifying options for which there is no separatecommand-line flag..It Fl p Ar portPort to connect to on the remote host.This can be specified on aper-host basis in the configuration file..It Fl qQuiet mode.Causes all warning and diagnostic messages to be suppressed..It Fl sMay be used to request invocation of a subsystem on the remote system. Subsystems are a feature of the SSH2 protocol which facilitate the useof SSH as a secure transport for other applications (eg. sftp). Thesubsystem is specified as the remote command..It Fl tForce pseudo-tty allocation.This can be used to execute arbitraryscreen-based programs on a remote machine, which can be very useful,e.g., when implementing menu services.Multiple.Fl toptions force tty allocation, even if.Nmhas no local tty..It Fl TDisable pseudo-tty allocation..It Fl vVerbose mode.Causes.Nmto print debugging messages about its progress.This is helpful indebugging connection, authentication, and configuration problems.Multiple.Fl voptions increases the verbosity.Maximum is 3..It Fl xDisables X11 forwarding..It Fl XEnables X11 forwarding.This can also be specified on a per-host basis in a configuration file..PpX11 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..It Fl CRequests compression of all data (including stdin, stdout, stderr, anddata for forwarded X11 and TCP/IP connections).The compression algorithm is the same used by.Xr gzip 1 ,and the.Dq levelcan be controlled by the.Cm CompressionLeveloption for protocol version 1.Compression is desirable on modem lines and otherslow connections, but will only slow down things on fast networks.The default value can be set on a host-by-host basis in theconfiguration files; see the.Cm Compressionoption..It Fl F Ar configfileSpecifies an alternative per-user configuration file.If a configuration file is given on the command line,the system-wide configuration file.Pq Pa /etc/ssh/ssh_configwill be ignored.The default for the per-user configuration file is.Pa $HOME/.ssh/config ..It Fl L Ar port:host:hostportSpecifies that the given port on the local (client) host is to beforwarded to the given host and port on the remote side.This works by allocating a socket to listen to.Ar porton the local side, and whenever a connection is made to this port, theconnection is forwarded over the secure channel, and a connection ismade to.Ar hostport.Ar hostportfrom the remote machine.Port forwardings can also be specified in the configuration file.Only root can forward privileged ports.IPv6 addresses can be specified with an alternative syntax:.Ar port/host/hostport.It Fl R Ar port:host:hostportSpecifies that the given port on the remote (server) host is to beforwarded to the given host and port on the local side.This works by allocating a socket to listen to.Ar porton the remote side, and whenever a connection is made to this port, theconnection is forwarded over the secure channel, and a connection ismade to.Ar hostport.Ar hostportfrom the local machine.Port forwardings can also be specified in the configuration file.Privileged ports can be forwarded only whenlogging in as root on the remote machine.IPv6 addresses can be specified with an alternative syntax:.Ar port/host/hostport.It Fl D Ar portSpecifies a local.Dq dynamicapplication-level port forwarding.This works by allocating a socket to listen to.Ar porton the local side, and whenever a connection is made to this port, theconnection is forwarded over the secure channel, and the applicationprotocol is then used to determine where to connect to from theremote machine.Currently the SOCKS4 protocol is supported, and.Nmwill act as a SOCKS4 server.Only root can forward privileged ports.Dynamic port forwardings can also be specified in the configuration file..It Fl 1Forces.Nmto try protocol version 1 only..It Fl 2Forces.Nmto try protocol version 2 only..It Fl 4Forces.Nmto use IPv4 addresses only.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -