Add a system user
If called with one non-option argument and the --system option, adduser will add
a system user. If a user with the same name already exists in the system uid
range (or, if the uid is specified, if a user with that uid already exists),
adduser will exit with a warning.
adduser will choose the first available UID from the range specified for system
users in the configuration file. The UID can be overridden with the --uid
option.
By default, system users are placed in the nogroup group. To place the new sys-
tem user in an already existing group, use the --gid or --ingroup options. To
place the new system user in a new group with the same ID, use the --group
option.
A home directory is created by the same rules as for normal users. The new sys-
tem user will have the shell /bin/false (unless overridden with the --shell
option), and have logins disabled. Skeletal configuration files are not copied.
Try creating your user as follows:The new system user will have the shell /bin/false (unless overridden with the --shell
option), and have logins disabled.
adduser username --system --disabled-password --shell /bin/shDrop your keys into place and give it a shot... it should work. Technically speaking, your system user does have a shell "/bin/false", which returns false and immediately terminates. The result is that you in fact are logging in, but are immediately and forcibly logged out as "/bin/false" terminates. You can replace "/bin/sh" with most any other command. You could (and maybe should) change the shell to the single command you wish to run on login, which restricts the user to that one command. It would also result in a forced logout immediately after that command terminates without need for a manual logout.