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
  • "comand not found" Similarly, with the commands reboot, usermod. I tried to search for them through whereis-search for them. I can't understand why the commands don't work?enter a description of the image here
Author: Vlad-i-mir, 2020-10-02

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 <аргументы>
 1
Author: aleksandr barakin, 2020-10-03 08:40:09

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/

 -1
Author: eri, 2020-10-02 20:59:44