View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed May 24, 2006 8:50 pm 
Offline
Joined: Mon Jun 07, 2004 11:48 am
Posts: 55
Ok, I'm an idiot....I forgot the super-user passwd on a new system I'm setting up for someone else. Is there a secret/backdoor way to boot in single user mode so I can delete the password (/etc/passwd)?

Had most everyting working great on a MSI K8NGM2-FID and DVICO RT gold card, but had to upgrade to latest nvidia drivers, upgrade to the latest alsa sound drivers and couldn't get the sensors working. The built-in 6150 works great with XvMC, though sometimes video freezes but can be correct by skip back or forward. The remote will not work, they changed from a USB one to one that connects thru their special cable that plugs into thier card (which allows power on/off control of computer).

Not sure if R5C7 corrects any of the above, suppose if there is no way to fix password, I'll try it...

Thx.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 24, 2006 8:54 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
hold down the left shift key after post.

at the "lilo: " prompt put "linux init=/bin/sh"

after you log in remount / read/write like so:

mount -o remount,rw /

then just use pico to edit /etc/passwd like so:

root::root:/root:/bin/bash


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 6:36 pm 
Offline
Joined: Mon Jun 07, 2004 11:48 am
Posts: 55
Thanks, that did the trick. Haven't used pico yet, prefer vi...


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 12:02 am 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
you might appreciate this then..

cat /etc/passwd | sed s/root:.*:0:0:/root::0:0:/ > /etc/passwd


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 6:47 am 
Offline
Joined: Mon Jun 07, 2004 11:48 am
Posts: 55
mac wrote:
you might appreciate this then..

cat /etc/passwd | sed s/root:.*:0:0:/root::0:0:/ > /etc/passwd


Nothing like a good ole line/stream editor :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 3:38 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
mac wrote:
cat /etc/passwd | sed s/root:.*:0:0:/root::0:0:/ > /etc/passwd

Yikes! :shock: Not recommended! There's a potential race condition there that could wipe out or corrupt the password file, it's much better to use a temporary file or the "edit in place" option than Gnu sed has. See the sed man page for more details.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 8:33 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
I am a bit curious about why it works ;) it shouldn't, but for some reason with small files I get
away with it.. i don't think that was the case pre 2.4 kernels.

I just figured that one of the kernel maintainers was reading my mind when I was thinking about
what would happen if a snake ate its own tail..


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 9:15 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Being able to "get away with it" sometimes is the nature of race conditions. The failure modes require that certain combinations of psuedo-random events occur. The really dangerous part is that because the cause and effect aren't clearly linked, after getting away with this kind of Russian roulette a few times, even smart people start thinking that it's "safe". Kind of like getting in the habit of running a red light at 4AM because "there's never anybody else on the road at this hour".


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu