Linux 命令行账户管理


Author: yifei / Created: May 29, 2017, 8:40 p.m. / Modified: May 29, 2017, 8:43 p.m. / Edit

执行 sudo vi /etc/suduers, 然后输入:

username ALL=(ALL) NOPASSWD: ALL

useradd -m USERNAME  # add a user
userdel USERNAME  # delete a user
passwd -e  # password expire next time user login

groups username  # view username groups
usermod -G groupname username  # add user to a group
usermod -g groupname username # set user to a group

newgrp
make newly added group work immediately without login/out

chsh 提示输入密码的问题

Changing /etc/pam.d/chsh: from:

auth       required   pam_shells.so
to

auth       sufficient   pam_shells.so

有任何问题可以发邮件到 kongyifei (at) gmail.com 讨论