[GLLUG] why is adduser unknown command in Debian 10.4?

James Roberts j.roberts at stabilys.com
Wed Sep 2 07:18:27 UTC 2020


"Use su - instead" - we always were supposed to do that and I tried to 
remember to do so, but bad habits learned early on persist and I often 
slipped. Now I'll be forced into canonicity :)

MeJ

On 01/09/2020 18:24, Andy Smith via GLLUG wrote:
> Hello,
> 
> On Tue, Sep 01, 2020 at 04:01:04PM +0000, MJ via GLLUG wrote:
>> desktop at desktop:~$ su
>> Password:
>> root at desktop:/home/desktop# adduser desktop dialout
>> bash: adduser: command not found
>> root at desktop:/home/desktop#
> 
> Most likely /usr/sbin isn't in your path as "su" doesn't do that any
> more.
> 
> https://wiki.debian.org/NewInBuster
> 
> == Changes
> 
> * The su command in buster is provided by the util-linux source
>    package, instead of the shadow source package, and no longer
>    alters the PATH variable by default. This means that after doing
>    su, your PATH may not contain directories like /sbin, and many
>    system administration commands will fail.
> 
>> This is LPC 101 standard stuff?!
> 
> Rote learning goes out of date. Working out how to diagnose a
> "command not found" error is more valuable.
> 
> $ command -v adduser
> /sbin/adduser
> # Oh, /usr/sbin is in my user's path then. Because I set that on purpose
> $ PATH= command -v adduser
> $ apt-file search bin/adduser
> adduser: /usr/sbin/adduser
> $ dpkg -L adduser | grep bin
> /usr/sbin
> /usr/sbin/adduser
> /usr/sbin/deluser
> /usr/sbin/addgroup
> /usr/sbin/delgroup
> $ ls -lah /usr/sbin/adduser
> -rwxr-xr-x 1 root root 34K Sep 15  2018 /usr/sbin/adduser
> 
> So, PATH issue.
> 
> Cheers,
> Andy
> 

-- 
Stabilys Ltd		www.stabilys.com
244 Kilburn Lane
LONDON
W10 4BA

0845 838 5370



More information about the GLLUG mailing list