具有以下操作系统:
当我执行ssh
命令时,我得到以下信息:
> ssh
usage: ssh [some characters shown] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]
根据Github
以下部分中的文档:
有以下语句:
$ ssh -T git@hostname
从上面观察-T
参数,它没有出现在第一个输出中。
它甚至没有出现在关于以下内容的“官方”文档中SSH
:
但它出现在例如 Ubuntu 文档命令中:
在这里我很困惑,因为在 Ubuntu 的文档中,-T
参数出现在描述部分,但没有出现在概要部分。问题1:为什么会有这种差异?
顺便说一句,我在 Ubuntu 中执行apt update
并apt upgrade
好吧,当我执行$ ssh -T git@hostname
命令时,我没有收到有关-T
参数无效的错误。因此它是有效的,但它没有出现在第一个输出中。
问题2:如果理论上-T
是无效参数,为什么命令执行不失败?
问题三:什么时候强制使用-T
?
Α
使用dpkg -l openssh-client
命令显示:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================================-===========================-===========================-===============================================================================================
ii openssh-client 1:7.6p1-4ubuntu0.3 amd64 secure shell (SSH) client, for secure access to remote machines
对于ssh -V
命令显示:
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
T
实际上,在您编辑的概要部分中提到了该选项:
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]
用法描述于man ssh
:
-T Disable pseudo-terminal allocation.
本质上是相反的-t
:
-t Force pseudo-terminal allocation. This can be used to execute
arbitrary screen-based programs on a remote machine, which can be
very useful, e.g. when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.
概要显示它喜欢[some characters shown]
而不是喜欢,[-p port]
因为它是不带参数的(许多)选项之一。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句