Hot answers tagged useradd
First set a variable containing the username: myUSER=user1 Then call the adduser script using: sudo adduser --ingroup teacher "$myUSER"
Probably because you do not use the userdel command as superuser (root) or other privileged user. Try: sudo userdel accountname As stated in several comments it is also possible to remove the homedirectory configured while removing the useraccount using: sudo userdel -r accountname
As per man useradd, it creates SUB_UID_COUNT secondary uid range reserved for each user SUB_UID_MIN (number), SUB_UID_MAX (number), SUB_UID_COUNT (number) If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate user IDs) allocate SUB_UID_COUNT unused user IDs from the range SUB_UID_MIN to SUB_UID_MAX for each new ...
Most programs that need to care about usernames will do a getent() lookup to find the UID and use that from then on - that's because users are identified by the uid, the number. The name is not much more than pretty-printing and convenience. For example, run id 1000 or getent passwd 1000 and they will only display the first entry for that uid. It is not ...
The adduser command by default also creates a /home/user directory for system users, which you cannot do with the useradd command. useradd only adds home directories for normal users not system users.
Only top voted, non community-wiki answers of a minimum length are eligible