How to add System user that not be shown in lightdm login screen window or User Accounts? - Ask Ubuntu
i want create user no login, no home , not shown in lightdm login screen window or user accounts tool. others users in /etc/passwd: sshd, syslog, avahi...
i've tried command line:
useradd -r -u 1001 -m -g 1001 media
but still can see user in user accounts tool:
thanks in advance!!
note: question has been claimed duplicated don't think so. main difference want create kind of user never shown in lightdm login screen window neither user accounts tool. user not have defined $home different thing.
use command:
$ sudo adduser --no-create-home --disabled-login --shell /bin/false --system --uid 1001 media $ sudo addgroup --gid 1001 media
when running test, using man pages arguments, -gid
in adduser
command suppose create group specified name , supplied number. however, in functionality has apparently changed without docs being updated. on test, specifying --gid
fails error: adduser: gid 1001 not exist
. dropped --gid
create new number when creating user, , added second command create group new user.
update:
edit file userid in /var/lib/accountsservices/users
dir include these lines:
in case run this:
$ sudo nano /var/lib/accountsservices/users/media
then ensure include these 2 lines:
(if user has logged on file should automatically created. if user hasn't logged on, won't exist. can manually create commandline above.)
[user] systemaccount=true
now either reboot or restart lightdm services (depending on ubuntu version):
(to avoid logging out can restart lightdm
ctrl+alt+f2. run command below console.)
$ sudo service lightdm restart
or (ubuntu 16.04 , higher)
$ sudo systemctl restart lightdm
note:
default, userid below 500 automatically hidden.
some information in update can found in /etc/lightdm/users.conf
file.
Comments
Post a Comment