Host name HostName ip Port port User username IdentityFile path/to/id_rsa
例如:
➜ .ssh cat ~/.ssh/config Host ssh1 HostName 10.173.32.108 Port 22 User root IdentityFile /Users/wenjun/.ssh/ssh1
然后只需要执行
ssh ssh1
即可连接
➜ ssh ssh1 The authenticity of host '10.173.32.108 (10.173.32.108)' can't be established. ECDSA key fingerprint is SHA256:KtMXK9uQgIAwzOkvvqncijKggykVjiRTuYnNH5gFslY. Are you sure you want tocontinue connecting (yes/no)? yes Warning: Permanently added '10.173.32.108' (ECDSA) to the list of known hosts. [root@test ~]# [root@test ~]# [root@test ~]# exit 登出 Connection to10.173.32.108 closed.