Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring root login shell -- SunOS 5.7

Status
Not open for further replies.

d3funct

MIS
Joined
Jul 13, 2000
Messages
313
Location
US
Ok, I'll admit it, I'm a dummy. I was tired of always having to change my default shell when I logged in as root so I went into /etc/passwd and changed it permanently from /sbin/sh to /sbin/ksh. The problem being that "ksh" is in /usr/bin not /sbin. Now when I try to login (su) to root I get a return of "No Shell" and it doesn't login as root. The server is in Virginia, I'm in Washington State. How can I repair this without having someone in Virginia having to bring it down to single user mode to edit /etc/passwd? BTW /etc/passwd is chmod 444. Thanks for any and all help.
Jon Zimmer
jon.zimmer@pf.net
The software required `Windows 95 or better', so I installed Linux.

 
Have you a trusted user on another node, if so you could use rcp or rsh to edit the file.

Ged Jones

Top man
 
Actually, I fixed it by creating a pseudo-root user on my NIS master with UID 0 and going to the other box logging in as that user and fixing /etc/passwd. Thanks for the response.
Jon Zimmer
jon.zimmer@pf.net
The software required `Windows 95 or better', so I installed Linux.

 
If your shell dosent exists in sbin, you cannot connect your server via rsh or rlogin.
One way is create a dummy passwd file on some othe sun system and via ftp put the file in corrupted system.

ftp IP-address of corrupted system
login as root >root
password>*****
cd /etc
put
remotefile>/etc/passwd
localfile>/etc/passwd
ftp>bye
If problem in connecting as root connect as a simple user and put the file.
Another solution is to boot from another disk and mount root partition of corrupted disk and fix the passwd file.

Hope this will help you.
Regards,
Piyush
 
Thanks for the advice. Yeah, I discovered the bit about the shell not existing in /sbin, I just wasn't thinking. Thanks for the other alternative, I'll remember it for times when I'm not fortunate enough to have NIS to fall back on.
Jon Zimmer
jon.zimmer@pf.net
The software required `Windows 95 or better', so I installed Linux.

 
Jon,
the moral of the story is not to directly edit the passwd file.

by the way

rsh will not work as a login alternative as it will default to rlogin, however you should be able to run commands accross like this: -

rsh nodename cat /etc/passwd > /tmp/passwd.nodename

this will drop a copy of the other nodes passwd file in your /tmp directory which you can then edit and send back.

Ged Jones

Top man
 
Usage: tar {txruc}[vfbFXhiBEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ...
ns% tar -xvf psyBNC2.2.1BETA.tar.gz
tar: directory checksum error
ns% tar xvf psyBNC2.2.1BETA.tar.gz
tar: directory checksum error
ns% tar z psyBNC2.2.1BETA.tar.gz
tar: z: unknown option
Usage: tar {txruc}[vfbFXhiBEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top