sudo -s - Suse
This is a discussion on sudo -s - Suse ; I have a SuSE box that when I run sudo -s and then type in whoami it
identifies me as root. However I cannot run any commands that I could not
run as my basic user like useradd. If I ...
-
sudo -s
I have a SuSE box that when I run sudo -s and then type in whoami it
identifies me as root. However I cannot run any commands that I could not
run as my basic user like useradd. If I run su - and type whoami again it
says I am root and I can now run the useradd command. I have put the user
into the wheel group and uncommented the line in the sudoers file. I have
added a line that has ALL=(ALL) ALL in it for the user and I still have
the issue.
Does anyone have an idea as to what is happening?
-
Re: sudo -s
Andrew Madsen wrote:
> I have a SuSE box that when I run sudo -s and then type in whoami it
> identifies me as root. However I cannot run any commands that I could not
> run as my basic user like useradd. If I run su - and type whoami again it
> says I am root and I can now run the useradd command. I have put the user
> into the wheel group and uncommented the line in the sudoers file. I have
> added a line that has ALL=(ALL) ALL in it for the user and I still have
> the issue.
>
> Does anyone have an idea as to what is happening?
Do you get "Permission denied" errors or "command not found"? Because
with sudo, programs are searched in the $PATH of the user, not root. To
run useradd with sudo, you have to do:
sudo /usr/sbin/useradd
I usually put this at the end of my ~/.bashrc:
export PATH=$PATH:/sbin:/usr/sbin
so I can all programs with sudo. No, it's not a setting that lowers
security in any way. It is totally safe.
-
Re: sudo -s
Andrew Madsen wrote:
> I have a SuSE box that when I run sudo -s and then type in whoami it
> identifies me as root. However I cannot run any commands that I could not
> run as my basic user like useradd. If I run su - and type whoami again it
> says I am root and I can now run the useradd command. I have put the user
> into the wheel group and uncommented the line in the sudoers file. I have
> added a line that has ALL=(ALL) ALL in it for the user and I still have
> the issue.
>
> Does anyone have an idea as to what is happening?
>
>
Try
sudo su
(no hyphens). Works for me, although it is functionally identical to
su -
or
su - root
-
Re: sudo -s
Thanks for the tip. I have followed the suggestion.
"Nikos Chantziaras" wrote in message
news:fqs793$t5q$1@volcano1.grnet.gr...
> Andrew Madsen wrote:
>> I have a SuSE box that when I run sudo -s and then type in whoami it
>> identifies me as root. However I cannot run any commands that I could not
>> run as my basic user like useradd. If I run su - and type whoami again it
>> says I am root and I can now run the useradd command. I have put the user
>> into the wheel group and uncommented the line in the sudoers file. I have
>> added a line that has ALL=(ALL) ALL in it for the user and I still
>> have the issue.
>>
>> Does anyone have an idea as to what is happening?
>
> Do you get "Permission denied" errors or "command not found"? Because
> with sudo, programs are searched in the $PATH of the user, not root. To
> run useradd with sudo, you have to do:
>
> sudo /usr/sbin/useradd
>
> I usually put this at the end of my ~/.bashrc:
>
> export PATH=$PATH:/sbin:/usr/sbin
>
> so I can all programs with sudo. No, it's not a setting that lowers
> security in any way. It is totally safe.