Non-root users can log in without password

Create test user

1. useradd test
2. passwd test
3. su test
4. cd /home/test

Password-free login

1. ssh localhost(会创建.ssh)
2. cd /home/test/.ssh
3. ssh-keygen -t dsa -P '' -f ./id_dsa (''是空,没有密码)

Insert picture description here

4. cat id_dsa.pub >> authorized_keys
5. chmod 600 authorized_keys
6. ssh localhost 发现不需要密码

Guess you like

Origin blog.csdn.net/weixin_42096620/article/details/110200514