服务器端

1. 修改 /etc/ssh/sshd_config 文件, 打开以下选项

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

2. 创建 .ssh 目录, 权限 700

    创建 .ssh/authorized_keys, 权限 640

 

客户端

1. 生成 rsa 密钥  ssh-keygen

2. 公钥追加到 host:~/.ssh/authorized_keys 中

cat .ssh/id_rsa.pub | ssh 用户名@IP  'cat >> .ssh/a'

  

相关文章:

  • 2021-08-27
  • 2021-05-20
  • 2021-05-24
猜你喜欢
  • 2021-05-25
  • 2021-06-20
  • 2021-07-18
  • 2022-01-21
  • 2021-09-30
  • 2022-12-23
  • 2021-12-02
相关资源
相似解决方案