Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
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!
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.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.