修改了服務(wù)器ssh默認(rèn)端口擦剑,在mac下測試始終報(bào)錯(cuò):
$ ssh -T git@centos-linux:222
ssh: Could not resolve hostname centos-linux:222: nodename nor servname provided, or not known
image.png
Mac下無法識別主機(jī)后面的端口號,換一種寫法即可:
$ ssh -p 222 git@centos-linux
The authenticity of host '[centos-linux]:222 ([10.211.55.11]:222)' can't be established.
ECDSA key fingerprint is SHA256:B5lVLZf/QVdTZX9jT/S2PgZq8VaTzaolgoMxgMAJckA.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[centos-linux]:222,[10.211.55.11]:222' (ECDSA) to the list of known hosts.
PTY allocation request failed on channel 0
Welcome to GitLab, 葛方帥!
Connection to centos-linux closed.
image.png