- 不允许root远程ssh访问
/etc/ssh/sshd_config文件,修改PermitRootLogin no
- 创建一个普通用户作为ssh远程访问账户
groupadd test_group
useradd -g test_group test_user
passwd test_user #修改密码
- 允许特定IP的特定用户和特定用户ssh远程访问
/etc/ssh/sshd_config文件末尾添加
AllowUsers test_user [email protected]
- 远程修改密码
ssh -p 20462 39.100.22.187 passwd testuser --stdin < ./passwd.txt