[plug] Interesting command that may make root access more fun ..
Patrick Coleman
blinken at gmail.com
Fri May 25 19:01:44 WST 2007
On 5/25/07, Tomasz Grzegurzko <tomasz89 at gmail.com> wrote:
> On 5/25/07, Richard Meyer <meyerri at westnet.com.au> wrote:
> > Sorry I didn't know exactly how to word the subject line, but my son
> > came up with something interesting that gets him root login without the
> > root password. He has to have sudo access and then types (at a console)
> > "sudo su" and there he is in all his glory.
> >
> > Interesting way to make yourself root permanently without the password.
> > Trust a 15-year-old to come up with something like that.
> >
> >
>
> sudo su -
> is better...
'sudo bash' (or zsh or whatever) and 'sudo -i' should do similar things.
sudo -i and sudo su - have the advantage of running bash as a root
*login* shell, as opposed to a root shell. You could also run 'sudo
bash -l' for the same effect, though the length of the command is
starting to get a bit silly.
The login shell will run the scripts in /root/.profile, /root/.bashrc
etc. and change to root's home directory as if root had logged in at
the console. Useful if you've got root setup with some custom
environment variables and/or scripting.
-Patrick
--
http://www.labyrinthdata.net.au
More information about the plug
mailing list