LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-18-2004, 07:48 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
$#!% passwd file removed, how do I log in as root?


In my failed attempt to edit the passwd file on all machines, I clobbered the passwd file on one machine, so it is now blank.

I can log into the machine via NIS as any normal user, but I can't login as root to restore the passwd file. Is there anyway to get logged in?

To make matters more complicated, this machine has no CD ROM drive. (I could have just used knoppix, mounted the drive, & restored the file if that were the case).
 
Old 08-18-2004, 08:04 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Reboot, single (or init 1) ... if it's an old enough
version of RH/MDK you'll get a root bash-prompt

If it's slack or another sensible distro;
single init=/bin/sh
(Btw, that's why my linux installs all have restricted
in their lilo-options ;})

Cheers,
Tink
 
Old 08-18-2004, 08:12 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally posted by Tinkster
Reboot, single (or init 1) ... if it's an old enough
version of RH/MDK you'll get a root bash-prompt

If it's slack or another sensible distro;
single init=/bin/sh
(Btw, that's why my linux installs all have restricted
in their lilo-options ;})

Cheers,
Tink
excellent idea, but I can't edit my /etc/inittab. Is there another way to specify the runtime level?
 
Old 08-18-2004, 08:14 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
At boot, as a kernel parameter
init 1
 
Old 08-18-2004, 08:19 PM   #5
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally posted by Tinkster
At boot, as a kernel parameter
init 1
YOU RULE!

Thanks.

 
Old 08-19-2004, 06:24 AM   #6
penguin4
Senior Member
 
Registered: May 2004
Location: california
Distribution: mdklinux8.1
Posts: 1,209

Rep: Reputation: 45
tinkster; I second that motion! for as long as responding to posts finally some one else with same problem i,ve had & bingo Tink to the rescue viola!
absolutely thank you. all my research & a simple solution such as U provided. Oh well that is how LQO forums work & Great! back to basics.
 
Old 08-19-2004, 02:23 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
BrianK, penguin4,

thanks for the praise, greatly appreciated :)


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm removed packages log? jpokrzyk Linux - General 1 02-14-2004 11:24 PM
removed dropline - can't log in, can't su synaptical Linux - Software 0 02-11-2004 06:04 PM
root passwd Prasanth Linux - General 0 03-17-2003 05:12 AM
root login incorrect ,then passwd root,but error sunnycn Linux - Security 6 05-20-2002 10:54 AM
root passwd baburaj Linux - General 7 04-16-2002 12:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration