LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 01-20-2003, 09:25 PM   #1
radskatehell
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Rep: Reputation: 0
Unhappy Password file


welp this stinks. i'm a redhat8 user and i screwed up my password file. if u guys dont know what im talking about, it is /etc/passwd

and somehow i messed it up. its a read-only file, and on the first line where it should say .../bin/bash, it only says /bin.

that is a problem because there is no shell defined for the root user. i can't login as root!
there are other passwd files though, such as the passwd.OLD located in the same directory. since these files cannot be altered, (except by root) i need another way to restore the old passwd file or change the current one by hand. i have never run in to this problem in my entire 4 year career with redhat, so i believe this could be a rare problem. please help as i really need to login and install some packages!
 
Old 01-20-2003, 09:32 PM   #2
d_daywalker
LQ Newbie
 
Registered: Jan 2003
Location: Philippines
Distribution: Red Hat
Posts: 6

Rep: Reputation: 0
Try booting your system either by single mode or rescue mode. You should be able to alter the passwd file since those mode doesn't require any user login.
 
Old 01-20-2003, 09:44 PM   #3
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Re: Password file

Quote:
Originally posted by radskatehell
welp this stinks. i'm a redhat8 user and i screwed up my password file. if u guys dont know what im talking about, it is /etc/passwd

and somehow i messed it up. its a read-only file, and on the first line where it should say .../bin/bash, it only says /bin.

that is a problem because there is no shell defined for the root user. i can't login as root!
there are other passwd files though, such as the passwd.OLD located in the same directory. since these files cannot be altered, (except by root) i need another way to restore the old passwd file or change the current one by hand. i have never run in to this problem in my entire 4 year career with redhat, so i believe this could be a rare problem. please help as i really need to login and install some packages!
Login as yourself and do

su - --shell=/bin/bash
 
Old 01-21-2003, 04:09 PM   #4
radskatehell
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Unhappy

that does not work! i get the error:

cannot login: /bin
permision denied
 
Old 01-21-2003, 04:32 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Use the first RH8 install disk and type "linux rescue" at the prompt. It will go through a startup that might make you think it is trying to install, don't worry, just answer the questions it asks (mouse keyboard language etc) then it will search for (and hopefully find) your system then mount it at /mnt/sysimage. chroot to /mnt/sysimage, cd to /etc then do a mv passwd.OLD passwd and reboot.

Sorry, probably better to cp passwd.OLD passwd

Else you can try and fix passwd manually...

Last edited by bulliver; 01-21-2003 at 04:34 PM.
 
Old 01-21-2003, 05:17 PM   #6
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Quote:
Originally posted by radskatehell
that does not work! i get the error:

cannot login: /bin
permision denied
What do you mean by "that" ?

Do you mean you cant login as yourself ?
OR
Do you mean the su command errors out?

If all you changed was root's login shell, then there is no reason that EITHER of those shouldn't work. If that is the case, there's something else going on and you'll have to use your rescue cd and follow bulliver's instructions.
 
  


Reply



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
rsynch with the --password-file???? jedimastermopar Linux - General 5 05-07-2005 01:25 PM
password file roAder Slackware 2 02-28-2005 06:08 PM
how to protect a file with password bobgodwinx Linux - Security 7 07-20-2004 08:47 AM
password file juno Linux - General 13 10-04-2002 09:27 AM
Password on zip file FNC Linux - Security 4 04-19-2002 11:01 AM

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

All times are GMT -5. The time now is 04:09 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