New answers tagged useradd
You should first initialize the passwd of your user : $passwd system-user then return two times in order to create a blank passwd. You can verify that there's no passwd in the file /etc/shadows (the second field should be empty). But yes, this account will not be protected even with no $HOME neither shell. All users with a sudo account will be able to ...
The account will be setup without login possibilities as there is no valid password assigned to the account, and that is different from no password. You can check this by doing sudo grep -f system-user /etc/shadow. The second field (between the first and second colon (:)) will be a '*' and no hash of any password you can provide will match against that. ...
You may not remove the primary group of any existing user. You must remove the user before you remove the group. (see gropudel documentation)
No. You just end up with users whose login group doesn't have a name.
Don't try making the login name longer, you'll probably find loads of places it breaks. Note that you don't have a problem with the number of possible login names (you only get UID_MAX-UID_MIN uids anyway, which is 59,000 on my system). The problem is just with how descriptive they are, but fortunately there's another field intended to be descriptive: the ...
Just call useradd and pass it the arguments you want. To create a system user, passs the -r option. If you don't want a home directory, pick something like /none and pass the -M option. If you want to be able to use su to run commands as that user, the user needs to have a valid shell. useradd -r -d /none -M -U -s /bin/sh I don't recommend modifying the ...
Simply adding an entry to /etc/passwd seems to do the job and work. I guess useradd is more robust as it does a couple of additional things without doing needless stuff like setting up a user directory. (It's a little weird though, that for such a small thing it needs to take 200ms and open and close /etc/passwd about 900 times as it strace shows.)
Simply create the user as usual, don't give it any password. Rm -rf the /home/thatuser directory, and edit /etc/passwd to set the shell for that user to /bin/false. You could model the /etc/passwd entry after other system users you may see in there. Just make sure you understand the /etc/passwd entry and google it if you need to. Of course also make sure ...
Top 50 recent answers are included