https://blog.csdn.net/qq_38250124/article/details/84946131

 

1.开启允许pubkey登录

vi /etc/ssh/sshd_config

#PubkeyAuthentication yes

#改为

PubkeyAuthentication yes

重启sshd服务

systemctl restart sshd

 

 

2.设置xxx账户 sudo 无密码权限

visudo

xxx   ALL=(ALL)       NOPASSWD: ALL

或者将该用户添加到wheel组
启用
## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

## Same thing without a password
%wheel  ALL=(ALL)       NOPASSWD: ALL

 

3.上传id_rsa.pub到/home/xxx/.ssh

cat id_rsa.pub >> authorized_keys

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案