View previous topic :: View next topic |
Author |
Message |
Prospero n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 29 Nov 2003 Posts: 70 Location: The Netherlands
|
Posted: Thu Apr 28, 2005 5:01 pm Post subject: [Solved] Locked out from root (su not working) |
|
|
Ok, I have a problem - I've been following the Gentoo Security guide:
http://www.gentoo.org/doc/en/gentoo-security.xml
Up to a certain point (just before firewall install)
And now I have a problem - after logging into my box through SSH, I try this:
Code: |
# su
Password:
su: Authentication failure
Sorry.
|
I tried 15 times, I am 100% sure the password is correct, and before rebooting it worked fine - so I figure I either screwed up something with PAM, or did something else I shouldn't have. Now since I can't login to root (disabled in SSH config), I have no idea how to fix this. I'm not sure if hooking up a monitor and keyboard to the computer will work, since I removed all terminals from SecuryTTY.
Anybody have an idea? I could try booting from LiveCD and mounting the drive from there and then making the changes, but I'm not sure if that'll work.
Any suggestions?
Last edited by Prospero on Thu Apr 28, 2005 8:42 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
moocha Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Thu Apr 28, 2005 5:04 pm Post subject: Re: Locked out from root (su not working, ssh secured) |
|
|
Prospero wrote: | I could try booting from LiveCD and mounting the drive from there and then making the changes, but I'm not sure if that'll work. | If you've locked yourself out via PAM (i.e. if login refuses to cooperate), something like that is the only way of getting back in in a reasonable amount of time. Basically mount the file systems just like you did when you installed Gentoo, i.e. (adjust node names as fit): Code: | mount /dev/hda2 /mnt/gentoo (note - adjust hda2 to whichever device holds your root file system)
mount --bind /proc /mnt/gentoo/proc
mount --bind /sys /mnt/gentoo/sys (note - this line only for a 2.6 kernel!)
mount --bind /dev/pts /mnt/gentoo/dev/pts | and chroot in: Code: | chroot /mnt/gentoo /bin/bash
source /etc/profile | You'll then be logged in having bypassed the login procedure and can make the necessary adjustments (whichever those are - you know what you changed). _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
GBob Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/129237860541d0bf6356f7c.gif)
Joined: 13 Nov 2004 Posts: 110 Location: Portland, Oregon
|
Posted: Thu Apr 28, 2005 5:07 pm Post subject: |
|
|
Making changes with the live cd should work, but if su is saying your password is incorrect, your SOL. You could elevate your normal user to the root group I suppose; but then you'd need to give files group write thoughout your system. I'm guessing it's going to be a long hard road, if you don't format and re-install. _________________ rank[0]-=('n'-'d');
rank[3]-=('b'-'d');
It is better to say nothing and have people think your are an idiot,
Than open your mouth and remove all doubt. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Prospero n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 29 Nov 2003 Posts: 70 Location: The Netherlands
|
Posted: Thu Apr 28, 2005 8:20 pm Post subject: |
|
|
I managed to regain terminal access, so I can at least log in as root through the virtual console
It turns out I took out the suid bit in su's permissions, so a simple
Solved the problem
Stupid me ![Embarassed :oops:](images/smiles/icon_redface.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
GBob Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/129237860541d0bf6356f7c.gif)
Joined: 13 Nov 2004 Posts: 110 Location: Portland, Oregon
|
Posted: Thu Apr 28, 2005 9:29 pm Post subject: |
|
|
Better then the alternative, and by far not the dumbest thing I've seen. Ever have someone remove the r from root? "Bow before me, for I am oot" just doesn't have the same affect. _________________ rank[0]-=('n'-'d');
rank[3]-=('b'-'d');
It is better to say nothing and have people think your are an idiot,
Than open your mouth and remove all doubt. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|