The commands reboot, dhclient, usermod, etc. do not work in Linux Debian10 on VirtualBox
I installed Debian 10 on VirtualBox 6. I made an apt update - everything seems to have passed the norms. Next, under root, I try to get the address, dns, and gateway:
dhclient
2 answers
From $ man su
:
-
,-l
,--login
...
initializes the environment variables HOME, SHELL, USER, LOGNAME, and PATH
Without specifying this option, the PATH
environment variable remains the same value that a" normal " user does not include directories./sbin
, /usr/sbin
and /usr/local/sbin
.
And the programs you have just listed are located in these directories.
Therefore, either add the mentioned option when executing the program su
:
$ su -l <другие аргументы>
Or specify the full path to the programs located in the directories /sbin
, /usr/sbin
and /usr/local/sbin
:
# /usr/sbin/usermod <аргументы>
Debian does not transmit */sbin/
to PATH
when entering via sudo or via root.
Quick fix and starts working
source /etc/profile
And so copy
cp /etc/profile /root/.profile
Or describe the new /root/.profile
without forgetting to load the PATH variable with the paths */sbin/