Add /usr/local/sbin to the PATH of a user
The easiest way is to add this line to your user's ~/.bashrc
file:
export PATH=$PATH:/usr/local/sbin
Bear in mind that /sbin/
, /usr/sbin
and /usr/local/sbin
are not in normal users' $PATHs by default because these directories tend to contain "dangerous" executables. Things like fdisk
or deluser
that need administrative privileges and can harm your computer. They should be in root
's path by default and you need to be root
to run them anyway, so it migh be a good idea not to add them to a normal user's $PATH.
Add the following to the end of the .bashrc
of the user:
export PATH=/usr/local/sbin:$PATH