D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] sudo su

 

Benjamin M. A'Lee wrote:
> On Mon, Dec 15, 2008 at 04:59:54PM -0000, Ray Smith wrote:
>> You can also use sudo su which will then aske for you account password. Then
>> any command you enter after that will be treated as a root command. Very bad
>> if you forget you are operating as root.
> 
> There's no sense in running 'sudo su' if you want a root shell. 'su' is
> a program that prompts for a password and gives you a root shell, like
> sudo, but it prompts every time. All 'sudo su' does is run su as root,
> bypassing su's password prompt in favour of sudo's.
> 
> sudo -s or sudo -i will give you a root shell (-i will simulate a login
> as root, so you'll get root's bashrc etc. rather than your own, and
> various environment variables will be set).
> 

Oooh that's handy, I've generally used sudo su.

I'll have to remember that (sudo -i)

Rob


-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html