29

Question: What is the most-ideal way to add new users in Debian? adduser appears to be missing on my system, any tips?

Log:

bash: adduser: command not found


Edit:

adduser does appear to be installed

adduser is already the newest version (3.118).

Is is possible to manually execute it as a binary? Where is the applications stored?

Jefferysons
  • 401
  • 1
  • 4
  • 7
  • Welcome to the site. Could you edit the question to include also the exact command-line (incl. prompt) you used and which led to this error message? It may help identify the problem. E.g.: adding a user is a process reserved to the system administrator `root`, and in the current form of the question, it is not apparent if you were `root` user or gained the necessary admin rights via a `sudo` call (hence the questions/remarks of the other contributors). – AdminBee Feb 04 '20 at 09:04

3 Answers3

35

Use su -l or su - to start the root shell with an environment similar to a normal 'login' shell. This includes initializing the environment variable $PATH for user root instead of simply inheriting it from the normal (non-sudo) user who does not have /sbin on her $PATH. See man su or https://linuxconfig.org/command-not-found-missing-path-to-sbin-on-debian-gnu-linux.

This is how to enable sudo after a fresh install of Debian 10:

$ su -l
# adduser <your_username_here> sudo
# logout

Then, log out of the Desktop Environment and log in again.

sgrubsmyon
  • 451
  • 4
  • 4
10

Adding sbin to path seems to at least temporarily fix the problem for me:

export PATH="$PATH:/sbin:/usr/sbin:usr/local/sbin"

Or try executing /sbin/useradd

Jefferysons
  • 401
  • 1
  • 4
  • 7
  • Thank you very much! Your work around did it for me. The only other thing that I had to do was to use the SUDO command to add the new user. – DrupalFever May 14 '20 at 18:40
0

which adduser will tell you where the bin is located.

You should be root when trying to add a user.

Alternatively you can use the useradd command, also as root.

Yevhen Stasiv
  • 175
  • 1
  • 8