Root shell in /etc/passwd is corrupted

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Root shell in /etc/passwd is corrupted
# 1  
Old 02-01-2010
Root shell in /etc/passwd is corrupted

I accidentally changed root shell from /bin/bash to bash in /etc/password, then logged out from root. Now I can't login as root and got "No shell" error, although I have root password. "su -f -s /bin/bash" command does NOT work. There is no GUI interface for this system.

My question: Do I have to reboot the system to single user mode to fix the problem?

Thank you in advance!

Last edited by aixlover; 02-01-2010 at 02:09 PM..
# 2  
Old 02-01-2010
Quote:
Originally Posted by aixlover
[...]/bin/bash to bash in /etc/password
[...]"su -f -s bin/bash" command does NOT work[...]
Aren't you missing a '/' here?
# 3  
Old 02-01-2010
There is only "bash" in the position of "/bin/bash".

su -f -s /bin/bash does not work. Sorry I missed the "/".
# 4  
Old 02-02-2010
Can you reboot your machine or it's not an option?

If you can - boot it with option init=/bin/bash
Then change your shell to proper one.

Regards,
-Artur.
# 5  
Old 02-02-2010
Can you login as a normal user and just issue "su" (with no parameters)?
Post withdrawn: Sorry, my mistake that will not work.

Last edited by methyl; 02-02-2010 at 11:53 AM..
# 6  
Old 02-02-2010
Quote:
Originally Posted by aixlover
I accidentally changed root shell from /bin/bash to bash in /etc/password, then logged out from root. [,,,]
My question: Do I have to reboot the system to single user mode to fix the problem?

Thank you in advance!
Artur's suggestion, if doable, is the best option available IMHO.

Loïc.
# 7  
Old 02-05-2010
Some more details please. Thanks a lot!


Quote:
Originally Posted by Artur Zaworski
Can you reboot your machine or it's not an option?

If you can - boot it with option init=/bin/bash
Then change your shell to proper one.

Regards,
-Artur.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Big problem: shell entry in /etc/passwd corrupted for user root

did a big mistake, changing root entry of /etc/passwd to root:x:0:0:root:/root:/usr/bin/tmux split-window -v \; attach as expected, now I can't login as root anymore. sudo ed /etc/passwd etc. doesn't work. Any idea? Use code tags to increase readability and follow the rules. (4 Replies)
Discussion started by: dodona
4 Replies

2. UNIX for Dummies Questions & Answers

Passwd Utility Corrupted

I have a legacy Solaris 8 machine. Someone has overwitten the passwd utility so I now can't change passwords. Is there somwhere I can download a copy? I do have the installation CDs as well. Thanks (1 Reply)
Discussion started by: hawess
1 Replies

3. Solaris

root mail file corrupted

Hi, We were facing cron job failures and raised a case to our UNIX team, they fixed the issue and said cron job failures due to root mail file corruption. My questions are, 1. Whether root mail file corruption cause cron job failures? 2. Do we have any size limitation for root mail file?... (0 Replies)
Discussion started by: paventhan
0 Replies

4. Solaris

PAM login library files corrupted, have ILOM, can I get root?

I was installing sfw sudo and its dependencies (libiconv, libintl, libgcc)on Solaris 10, running on an x86 x4200 and I corrupted some PAM library files. It's a standard Solaris 10 base install, with some added software & libraries from a vendor. I am on console trying to get root access back,... (1 Reply)
Discussion started by: Mariognarly
1 Replies

5. UNIX for Dummies Questions & Answers

hw to reterive root passwd

heyy i forgot my root passwd but i cant reinstall due to some reason can anyone tell me hw to reterive root passwd (10 Replies)
Discussion started by: mightypp.nits
10 Replies

6. Solaris

Recover root passwd

Any body pls let me know the procedure to recover ROOT password in Sun Netra 20 Server..I forgot the password. (5 Replies)
Discussion started by: gini
5 Replies

7. UNIX for Dummies Questions & Answers

Need to change root passwd

I booted up Sun V240 server with boot cdrom -s using the Sun Operating System CD. I now am at the # prompt and su - root . The system will not allow me to set password for root. Get following error: # passwd New Password: xxxxxxxx Re-enter new Password: xxxxxxxx passwd: Unexpected failure. ... (4 Replies)
Discussion started by: mayewil
4 Replies

8. UNIX for Advanced & Expert Users

Preventing passwd root?

I knew it would happen sooner or later.... We have a requirement that specific individuals need "sudo root" authority. I knew it only a matter of time before someone decided to change the root password (at least they owned up to it). Now the question is how can I grant all rights except... (4 Replies)
Discussion started by: scottsl
4 Replies

9. UNIX for Dummies Questions & Answers

Help! passwd file corrupted

Hi, I am new to UNIX, and have recently installed Suse 9.3. I have been experimenting with all of the commands and have somehow managed to modify the default shell of the root user to an invalid file. Consequently I cannot su to the root user as I receive the 'no such file or directory' error... (2 Replies)
Discussion started by: Tony Montana
2 Replies

10. HP-UX

passwd file corrupted

Good Day Our HP box was hacked and the passwd file has been altered,there are only 2 user accounts active,and these dont have any administrative rights.I need to edit the passwd file to correct the su and root entries. Does any body have any suggestions as to how i can do this with out the root... (10 Replies)
Discussion started by: cantona7
10 Replies
Login or Register to Ask a Question