美文网首页
[Mac]ssh免密登陆配置

[Mac]ssh免密登陆配置

作者: LeeYunFeng | 来源:发表于2017-04-19 00:15 被阅读0次

在已经有公钥和私钥的情况下,只需要以下三步即可实现免密登陆:

1、将已有rsa公钥和私钥拷贝到~/.ssh目录下。

2、编辑配置文件:vim ~/.ssh/config,内容如下:

Host  xxx# server name

HostName  xx.xx.xx.xx# ip

Port xxx # port

User xxx # username

PreferredAuthentications publickey

IdentityFile ~/.ssh/id_rsa

3、在终端执行 ssh servername 命令,即可实现免密登陆。

相关文章

网友评论

      本文标题:[Mac]ssh免密登陆配置

      本文链接:https://www.haomeiwen.com/subject/oufczttx.html