| 知乎专栏 |
-o option
Can be used to give options in the format used in the configuration file. This is useful for specifying options for which there is no separate command-line flag. For
full details of the options listed below, and their possible values, see ssh_config(5).
[root@netkiller tmp]# ssh root@192.168.2.18
The authenticity of host '192.168.2.18 (192.168.2.18)' can't be established.
RSA key fingerprint is 83:e9:fc:a9:98:6b:33:41:0f:b2:44:13:01:f5:af:3c.
Are you sure you want to continue connecting (yes/no)?
===>这段话的意思是,无法确认host主机的真实性,只知道它的公钥md值,问你还想继续连接吗?
[root@netkiller tmp]# ssh -o stricthostkeychecking=no root@192.168.2.18
Warning: Permanently added '192.168.2.18' (RSA) to the list of known hosts.
root@192.168.2.18's password:
iMac:ensd neo$ ssh admin@172.18.100.253 -v OpenSSH_8.6p1, LibreSSL 3.3.6 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: Connecting to 172.18.100.253 [172.18.100.253] port 22. debug1: connect to address 172.18.100.253 port 22: Operation timed out ssh: connect to host 172.18.100.253 port 22: Operation timed out
mvn package scp -f target/*.jar root@www.netkiller.cn:/opt/cordyceps/ ssh root@www.netkiller.cn "cd /srv/cordyceps && git pull" ssh root@www.netkiller.cn "cd /srv/cordyceps && python docker.py -e cordyceps restart" ssh -t root@www.netkiller.cn "cd /srv/cordyceps && export TERM=xterm-256color && python docker.py -e cordyceps logs"
-t:强制 SSH 分配 伪终端(PTY)没有 -t 时,远程认为不是终端,自动禁用 ANSI 颜色
export TERM=xterm-256color 告诉远程:“我这终端支持 256 色 ANSI”