1

Code and outputs

apt-cache search adduser
adduser - add and remove users and groups
$ sudo apt-get install adduser
Reading package lists... Done
Building dependency tree       
Reading state information... Done
adduser is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ add
add-apt-repository  addpart             addr2line           
$ which adduser
$ echo $PATH
/home/masi/bin:/sbin/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

which I do not understand since it says that I have adduser but it is not in the PATH although I have most bin folders. There must be other location where adduser is added in Debian 8.1.

Where is adduser installed in Debian 8.1?

5
  • 3
    I find it at /usr/sbin/adduser.
    – fd0
    Commented Jul 13, 2015 at 11:16
  • @fd0 Please, make that an answer. You are correct! I do not understand why this PATH is not set correctly by default. I put PATH="$HOME/bin:/sbin/:/usr/sbin/:$PATH" in my $HOME/.bashrc. Commented Jul 13, 2015 at 11:19
  • 1
    PATH is set correctly by default - with /sbin and /usr/sbin for root, and without them for normal users. What did you expect? Commented Jul 13, 2015 at 11:26
  • 1
    @Masi There is no need to add /sbin and /usr/sbin to your PATH. The secure path is set in /etc/sudoers.
    – fd0
    Commented Jul 13, 2015 at 12:20
  • @fd0 Yes, you are so right. Thank you for pointing that out! Please, make the edit to your answer to your answer too, not to confuse people reading this thread afterwards. Just login first by sudo -i and search add[tab]. Commented Jul 13, 2015 at 12:30

1 Answer 1

3

When I'm looking for a tool I first look to see if it is in my PATH.

    type adduser
    bash: type: adduser: not found

If it is not found then I'll use apropos

    apropos adduser
    add.user.conf (5) - configuration file for adduser (8) and addgroup (8) .
    adduser (8)       - add a user or group to the system

Section 8 is System administration commands and daemons. So, I would look in /sbin or /usr/sbin. /sbin and /usr/sbin are left out of a normal user's PATH for security and many of those commands require root privileges to run. Both are added to your path by /etc/sudoers when you preference a command with sudo.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .