[GRLUG] get back access to root
Michael Mol
mikemol at gmail.com
Tue Sep 5 23:38:46 EDT 2006
LiveCD route:
1. Drop in an Ubuntu or KNOPPIX LiveCD
2. Open a terminal
3. Mount the hard drive
4. Modify /etc/hosts and /etc/hostname
5. Unmount the hard drive
6. Reboot
On 9/5/06, Bob Kline <bob.kline at gmail.com> wrote:
> Thanks. I'll try that. What's the LiveCD route?
>
> -Bob
>
>
> On 9/5/06, Michael Mol <mikemol at gmail.com> wrote:
> > Hm. Well, there's the generic Linux root exploit, if you don't want
> > to go the LiveCD route. (Though the LiveCD route is easier, IMO)
> >
> > Add the following to your kernel command line when you see the grub boot menu:
> > init=/bin/sh
> >
> > Next, remount your root filesystem so that you can write to it:
> > mount -o remount,rw /
> >
> > Then modify your host and hosts file as necessary:
> > /usr/bin/vi /etc/hosts
> > /usr/bin/vi /etc/hostname
> >
> > Now remount your root filesystem as read-only (to save your changes to it):
> > mount -o remount,ro /
> >
> > Finally, power off your computer. (The halt and shutdown commands
> > won't work; They depend on init or xinit, which isn't running. Just
> > hold the power button in for at least four seconds.)
> >
> > On 9/5/06, Bob Kline <bob.kline at gmail.com> wrote:
> > > Step two is the problem: su.
> > >
> > > I can't get in as root. I can log in
> > > as myself fine.
> > >
> > > -Bob
> > >
> > >
> > > On 9/5/06, bfdamkoehler at worldnet.att.net <bfdamkoehler at worldnet.att.net> wrote:
> > > >
> > > > I don't know your level of knowledge, so forgive me this is too
> > > > detailed. I assume that your problem is caused by the new hostname not
> > > > being /etc/hosts. Its seems like that might affect X windows but
> > > > "shouldn't" bother any non-X apps.
> > > >
> > > > * login to your non-priv account
> > > > * su
> > > > * cd /etc
> > > > * cp -v hosts hosts.save # make sure you have a saved copy in case
> > > > of problems
> > > > * vim hosts
> > > > o shift o
> > > > o newhostname nnn.nnn.nnn.nnn (replace newhostname with your
> > > > new hostname and nnn.nnn.nnn.nnn with the IP address of your
> > > > machine)
> > > > o hit the ESC key and then type :wq
> > > >
> > > > That "should" fix it, but you will still have the old hostname for your
> > > > machine in /etc/hosts as well, which won't hurt anything. You can tell
> > > > if its working by typing "ping newhostname" unless you have a firewall
> > > > that blocks ping packets.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Michael Mol wrote:
> > > >
> > > > >Did you check that /etc/hosts and /etc/hostname is sane?
> > > > >If not, can you fix them using sudo and vim?
> > > > >
> > > > >If you can't use sudo et al, try booting off of a livecd and edit the
> > > > >files that way.
> > > > >
> > > > >On 9/4/06, Bob Kline <bob.kline at gmail.com> wrote:
> > > > >
> > > > >
> > > > >>* used hostname to change, well, the host name.
> > > > >>
> > > > >>* now cannot get back in as root. I get a message
> > > > >> saying something like gethostbyname() doesn't work.
> > > > >>
> > > > >>What have I done to my self? Is there a way to get
> > > > >>back in as root, or have I found a way of locking myself
> > > > >>out of the system now?
> > > > >>
> > > > >>I won't even get in to why I tried to do this....... :-(
> > > > >>
> > > > >>More tales of the amateur.
> > > > >>
> > > > >> -Bob
> > > > >>_______________________________________________
> > > > >>grlug mailing list
> > > > >>grlug at grlug.org
> > > > >>http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
> > > > >>
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > _______________________________________________
> > > > grlug mailing list
> > > > grlug at grlug.org
> > > > http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
> > > >
> > > _______________________________________________
> > > grlug mailing list
> > > grlug at grlug.org
> > > http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
> > >
> >
> >
> > --
> > :wq
> > _______________________________________________
> > grlug mailing list
> > grlug at grlug.org
> > http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
> >
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>
--
:wq
More information about the grlug
mailing list