1
I'm currently configuring a Samba 4 DC on CentOS 7.
As myself, samba-tool
runs fine but when I run sudo samba-tool
I get command not found
.
samba-tool
is located in /usr/local/samba/bin
. I've added the directory to the PATH for both myself and root.
As myself, env | ^PATH=
correctly includes the above directory. However, sudo env | ^PATH=
shows only PATH=/sbin:/bin:/usr/sbin:/usr/bin
.
Switching now to the root user. env | ^PATH=
returns PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/samba/bin:/usr/local/samba/sbin
and samba-tool
runs just fine.
It was my intuition that sudo perfectly mirrored the root user, which I guess is not the case. A fix and hopefully an explanation is highly appreciated.
Try using 'su', then execute the command without 'sudo'. – TooMuchRAM – 2017-06-27T12:41:04.977
@Thijs365 I don't understand, do you mean switch into root and run the command? I'm already aware that that works. – Oliver Benning – 2017-06-27T12:45:27.067
Okay. Are you sure you have sudo installed? – TooMuchRAM – 2017-06-27T12:46:29.367
@Thijs365 Yes. Sudo works as expected for its env path above. – Oliver Benning – 2017-06-27T12:49:59.200
Okay. I won't say anything anymore. – TooMuchRAM – 2017-06-27T12:50:44.943