1、修改密码:passwd root

2、创建新用户:useradd -m xuanxi
3、查看用户名和密码:tail /etc/passwd(最后一条加上了xuanxi用户)

4、查看进和密码:tail /etc/passwd


5、编辑/etc/passwd/密码:vim /etc/passwd(在root和xuanxi用户后面加上/sbin/nologin禁止别人登录)

按“i”-->进入编辑模式--->在root和xuanxi最后加上 /sbin/nologin

按“Esc”---->输入“:wq”--->保存退出
六、在查看/etc/passwd:cat /etc/passwd(此时已加上/sbin/nologin,代表不可登录)

网友评论