1.新建用户 adduser user1 2.新建密码 //输入两次密码 # passwd user1 Changing password for user user1 New password: SEANzhui565520 Retype new password: passwd: all authentication tokens updated successfully cat /etc/passwd 可以查看所有用户的列表 w 可以查看当前活跃的用户列表 cat /etc/group 查看用户组
禁止root登录
1.编辑 sudoers文件 vim /etc/sudoers ,在root ALL=(ALL) ALL下添加以下代码 user1 ALL=(ALL) ALL 2.编辑vim /etc/ssh/sshd_config 修改#PermitRootLogin yes 为PermitRootLogin no 3.赋予sean用户root权限 A.在root ALL=(ALL) ALL下添加以下代码 user1 ALL=(ALL) ALL B.第二种方案,把用户ID修改为0 user1:x:0:1000:sean,,,:/home/sean:/bin/bash