将公钥内容添加到服务器中(可以直接复制内容:authorized_keys)
客户端生成密钥和公钥
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
默认在~/.ssh/目录下
执行上面命令执行会 生成下面的密钥对
密钥:id_rsa
公钥:id_rsa.pub
将公钥内容添加到服务器中(可以直接复制内容:authorized_keys)
cat id_rsa.pub >> ~/.ssh/authorized_keys
配置ssh
vim /etc/ssh/ssh_config
#修改
PasswordAuthentication no
PubkeyAuthentication yes
#重启
sudo systemctl restart sshd
除特别注明外,本站所有文章均为作者原创。 或分享自己的编程经验,或探讨工作中的问题,或聊以人生趣事。 转载请注明出处来自 https://www.qiusuoweb.com/159.html
运营天数
总访问量
文章数量
-
-
-
交流群:157451741
新浪微博:草莽兴
发布评论