Re: sudo path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



but su - will change the user to root.
any other way ?
I don't want to change the user to root and work,
want to stay with the same user, but having my PATH apply while I am using sudo

sudo man page says we can user -s to use SHELL environment, so I can alias sudo to sudo -s but still I should set this alias on all of our servers that I am going to login.

The *-s* (/shell/) option runs the shell specified by the /SHELL/ environment variable if it is set or the shell as specified in /passwd/.

thanks

Brad Oaks wrote:
And while you're at it, you might as well supply the full path to su.
Quite a while ago I was taught to give the full path to su.  This
instruction was given with a warning that it's more secure in case a
malicious user was able to get a command named 'su' into your path
ahead of the binary you're intending to execute.

I use:
sudo /bin/su -

Although, presumably under this logic, someone could have snuck
another binary in named 'sudo', too.  To take my own medicine, I
should be doing:
/usr/bin/sudo /bin/su -

Putting my $0.02 in where it wasn't necessarily asked for,
--bradoaks

On 7/21/07, Johnny Hughes <johnny@xxxxxxxxxx> wrote:
centos wrote:
> Hello
>
> Any time I am running sudo, I should have full path to the command,
> for example sudo /sbin/ifconfig
>
> Is there any way to set the path for sudo ?

use this command to get that (instead of just sudo):

sudo su -



_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux