[plug] Interesting command that may make root access more fun ..
Richard Meyer
meyerri at westnet.com.au
Fri May 25 19:19:56 WST 2007
On Fri, 2007-05-25 at 19:01 +0800, Patrick Coleman wrote:
> 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
>
Yep, well, every time before when I wanted root access I used "su" and
entered the root password. But at the moment my son's idea (and it may
be an old one) seems to be joint first in the "su golf" competition. (If
we can have "perl golf", why not "su golf" - it's Friday, after
all). ;-)
--
Richard Meyer <meyerri at westnet.com.au>
Necessity is the plea for every infringement of human freedom.
It is the argument of tyrants; it is the creed of slaves.
William Pitt, 1783
Linux Counter user #306629
More information about the plug
mailing list