Welcome to the Linux Foundation Forum!

how is it possible that the useradd command is not found although a man entry exists?

Best Answers

  • luisviveropena
    luisviveropena Posts: 1,316
    Answer ✓

    Hi @austrianadmin,

    1.- What Debian version are you running?
    2.- On Debian it seems that 'useradd' is provided by the passwd tool. So the documentation should be provided by the same package. You can check on it as follows:

    dpkg -L passwd

    3.- Can you try using 'adduser' instead? Perhaps something related to sudo and/or the PATH variable isn't working as expected.

    4.- You also can do this in order to find the tool:

    which useradd
    /usr/sbin/useradd

    sudo find /usr/sbin/ -name useradd
    /usr/sbin/useradd

    (Or look for it on / using sudo).

    But that's Ubuntu.

    Regards,
    Luis.

  • luisviveropena
    luisviveropena Posts: 1,316
    Answer ✓

    Hi Berni,

    I did a test on Debian 13.2 and both tools -adduser and useradd- worked:

    luis@debiansrv:~$ cat /etc/os-release
    PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
    NAME="Debian GNU/Linux"
    VERSION_ID="13"
    VERSION="13 (trixie)"
    VERSION_CODENAME=trixie
    DEBIAN_VERSION_FULL=13.2
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"

    luis@debiansrv:~$ sudo adduser user1
    New password:
    Retype new password:
    passwd: password updated successfully
    Changing the user information for user1
    Enter the new value, or press ENTER for the default
    Full Name []:
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
    Is the information correct? [Y/n] Y

    luis@debiansrv:~$ id user1
    uid=1001(user1) gid=1001(user1) groups=1001(user1),100(users)

    luis@debiansrv:~$ sudo useradd user2
    luis@debiansrv:~$ id user2
    uid=1002(user2) gid=1002(user2) groups=1002(user2)

    So, please try on Debian 13, as some issues related to Debian 12 could be playing a role here (you also can Google for 'debian 12 adduser won't run').

    Regards,
    Luis.

Answers

  • Hi Luis,
    It is Debian 12, i tried adduser instead...my PATH Variable: echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
    ....is it the PATH?.....when i type which useradd....no reaction...then i tried...sudo find /usr/sbin/-name useradd
    [sudo] password for newuser1:
    find: ‘/usr/sbin/-name’: No such file or directory
    find: ‘useradd’: No such file or directory
    ....i would love to solve that issue..thanks for your help

    best berni

Categories

Upcoming Training