New answers tagged useradd
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 ...
/etc/group lists all the groups, when you issue the command: groups It shows you all the groups you belong to, Which is gotten from /etc/group /etc/passwd shows all the information for a user, stuff like username, userid, default groupid, home directory, and your default shell. The user is added to this file once you create then via adduser. Another ...
The list of groups a user belongs to is stored in /etc/group When you add a user to group /etc/group is updated. The /etc/passwd file doesn't tell you which users belong to which groups. It only has the group id of the user's default group. The groups command returns info from /etc/group
Top 50 recent answers are included