以下我以阿里云为例
1.在Mac上打开终端,选择Shell中的新建远程链接,如下如
2.填入你阿里云公网的IP,如下如所示
3.然后直接点击链接就可以了,会出现如图的界面
因为我做演示的时候把之前的IP删掉了,如果遇到下边的问题,请执行ssh-keygen -R xxx.xxx.xxx.xxx(也就是你之前的ip),再次连接,然后会提示,直接输入yes就可以了,这可能是一个坑
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!Someone could be eavesdropping on you right now (man-in-the-middle attack)!It is also possible that a host key has just been changed.The fingerprint for the RSA key sent by the remote host isSHA256:这里每个人都不同Please contact your system administrator.Add correct host key in /Users/Anan/.ssh/known_hosts to get rid of this message.Offending RSA key in /Users/Anan/.ssh/known_hosts:1RSA host key for 这里是服务器的IP has changed and you have requested strict checking.Host key verification failed.
5.连接服务器,输入你设置的密码