用惯了Win的xshell,忽然到了mac下面就忽然茫然了,后来厚着脸问人家用什么工具,人家说用 iterm2+证书登录,恍然大悟,
os x 不也就是linux吗?
那就简单了,在iterm2 中输入ssh-keygen 一路回车
然后在~/.ssh 产生了id_rsa.pub和id_rsa 文件,将pub公钥上传到服务器的~/.ssh/authorized_keys ,然后修改配置
修改sshd配置文件(/etc/ssh/sshd_config).
找到以下内容,并去掉注释符”#“
=========================
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
=========================
然后重启ssh,这下在iterm2 中配置下连接指令,搞定。