Skip to content

Instantly share code, notes, and snippets.

@shui
Last active January 16, 2018 07:59
Show Gist options
  • Save shui/58c3e5db451b91a63326d2790c2148cd to your computer and use it in GitHub Desktop.
Save shui/58c3e5db451b91a63326d2790c2148cd to your computer and use it in GitHub Desktop.
ubuntu 登录界面屏蔽其他用户

查看用户组

cat /etc/group

查看所有用户

cat /etc/passwd

添加用户组

groupadd test -g 900

向test组添加用户,并禁止登录,且不分配目录

sudo useradd test -u 901 -g 900 -s /sbin/nologin -d /dev/null

在登录界面屏蔽其他用户名

linxu系统用户的 id >= 1000 的用户的账户会出现在登录界面
这样将需要屏蔽的用户和组的id修改为1000以下即可
(500以内是保留id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment