On an Ubuntu machine, if I run the following command:
adduser --system --no-create-home system-user
I create a system user named system-user without home directory with /bin/false as the shell. This user belongs to the nogroup (GID 65534) by default. I want to use this user to run a daemon on my system.
But what about the password? Can I or someone else somehow login into this system account? I thought that maybe the password is empty, so I just tried to press Enter when the Password: prompt appears in su system-user:
$ su system-user
Password:
su: Authentication failure
Is it because of the /bin/false shell? I don't know it because adduser and useradd manuals don't say how the password of system users is handled when the system user is created.
Can I be sure that no one in the system can login as this system user? Or should I do something else in order to protect this account? I would like that only the daemon will be able to use it and no one else...
su system-userandsudo su system-user(or runningsu system-useras root): You will be able tosuinto that user, independently of the fact if there is a password set. Most system users however have/usr/sbin/nologinor/bin/falseas default shells, making it impossible to successfullysuinto that user. Changing the default shell will allow you assigningsystem-user's identity.