免密码登录Linux


## 步骤

  1. 本地生成公钥和私钥,ssh-keygen -t rsa
  2. 查看本地公钥~/.ssh/id_rsa.pub
➜  ~ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCxQA7s3XJPyr9Du1LTjNigXL4BrgQERsmmT54c9e8BEKrb7o+ls/TidJWJETpmYGtciGBkC4HvrsUqLfi6x4jbwk/0q7Zwv/fjuwkyamFOagAglehicYUwANNBUSv1qg5szNu84RlusA3PHNOJoP34uzMm4R0NZ0O/pwnYZOizqu7SE3udV9T+sb/5aZrHMW8lJnOMoTDw4U/rC6B946bdJlLSYu4nAO3Oviq5jt81TNNTmGaAzZKsJq0oyV2dXIuU+dtfdY7yjKkcUHD4MIBIeo96PejvL7LGtg4tCiebsEkyo5/q9N0fMi9b78HX2BIf+B+UvFoSrmsG2MFzPKl finlay@Finlay-MacBook-Pro.mshome.net
  1. 将本地公钥追加到服务器/root/.ssh/authorized_keys文件;

## 注意事项

不建议直接使用本地id_rsa.pub覆盖服务器的authorized_keys文件,最好追加内容。


## 参考链接





© 2019-2023 coggle.club 版权所有     京ICP备20022947    京公网安备 11030102010643号