A simple and direct answer is, no.
Please take a look at the system users in ‘/etc/passwd’ and the man page 5 for “shadow”.
A couple of examples –
dnsmasq:x:495:65533:dnsmasq:/var/lib/empty:/bin/false
ftpsecure:x:458:65534:Secure FTP User:/var/lib/empty:/bin/false
man:x:13:62:Manual pages viewer:/var/lib/empty:/sbin/nologin
rpc:x:473:65534:user for rpcbind:/var/lib/empty:/sbin/nologin
vnc:x:462:464:user for VNC:/var/lib/empty:/sbin/nologin
They’re all system users (used by system daemons), without a Home directory –
> l -d /var/lib/empty
drwxr-xr-x 2 root root 4096 15. Mär 2022 /var/lib/empty/
>
> rpm --query --whatprovides /var/lib/empty
filesystem-15.0-11.8.1.x86_64
>
The empty directory ‘/var/lib/empty’ is a directory defined by the “filesystem” package –
- The package description is as follows –
This package installs the basic directory structure. It also includes the home directories of system users.
This empty directory is used to strictly adhere to the requirements of the file ‘/etc/passwd’ and in particular the field “directory” –
This is the user’s home directory: the initial directory where the user is placed after logging in. The value in this field is used to set the HOME environment variable.
The effect on a Linux system if a user’s entry in ‘/etc/passwd’ has an empty “directory” field is undefined – in other words, the system’s behaviour if this field is empty cannot be guaranteed …
Now, ‘/etc/shadow’ –
dnsmasq:!:18492::::::
ftpsecure:!:18493::::::
man:!:18492::::::
rpc:!:18492::::::
vnc:!:18492::::::
The second field – “encrypted password” contains the character “!” – meaning –
A password field which starts with an exclamation mark means that the password is locked. The remaining characters on the line represent the password field before the password was locked.
In other words, the password is locked and, there’s no password.
The commands to do this are as follows –
# passwd --delete [LOGIN]
# passwd --lock [LOGIN]
Where “LOGIN” is the user’s login name as defied by the left most field of the ‘/etc/passwd’ fields.
Now the right most field of the entries in ‘/etc/passwd’ – “shell”
- If the value is either “/bin/false” or “/sbin/nologin” the user can never, ever, login.
The two variations have different effects on anyone who attempts just that –
false - do nothing, unsuccessfully
nologin - politely refuse a login