//1,创建用户 
useradd name

//2,修改密码
passwd name

//3,修改ssh配置文件,在最后一行添加AllowUsers name
vi /etc/ssh/sshd_config

//4,重启ssh服务
service sshd restart

可以在/etc/ssh/sshd_config中增加AllowUsers:username(可以多个,空格分开)给普通用户增加ssh权限

也可以设置允许和拒绝ssh的用户/用户组: 
DenyUsers:username,DenyGroups:groupname

优先级如下: 
DenyUsers:username 
AllowUsers:username 
DenyGroups:groupname 
AllowGroups:groupname

在给普通用户设立ssh权限后,即可将root ssh权限禁用,增加安全性(也可以在sshd_config中将PermitRootLogin 选项修改为:PermitRootLogin no)

 

相关文章:

  • 2022-12-23
  • 2021-10-09
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-07-26
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-12-06
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案