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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Shell in /etc/passwd is bad

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
0
0
US
I have a non-existing shell (bad name) for root in my /etc/passwd file.

I have a good copy of the passwd file (from the original server) on another server.

Is there anyway to get it over to the server and overlay.

I can not rlogin, telnet, FTP, rsh......

Any Ideas?

The only way I can figure on getting around this is to Boot in Single User Mode... I am in Georgia and the Server is in St. Louis....
 
BTW, Thanks for the welcom Ken. A bit of background and why I sound like such a pompopus twit. I worked as a backline OS support engineer in the Sun Microsystems Customer Care Center (which seems to have devolved to more of a customer ignore center lately). I've trolled the code of the OS and am currently a systems admin at another company. If it's Solaris 2.5.1-solaris 9, and not a storage problem, I can find an answer. Unfortunately for me, I'm a SAN idiot and fighting an uphill battle with an HDS.. the search for solutions to that led me here. So I thought I'd help out here while looking for my own answers in the HDS forums......
 
WhiteVolg - pomposity doesn't appear to be a feature of the posts I've read. I'm sure everyone appreciates experience such as yours on the forum. We have another ex-Sun guy in daFranz (and possibly others), and his postings have been invaluable to many for quite a while.
 
which seems to have devolved to more of a customer ignore center lately
That statement is very accurate! It seems whenever I open a case I have to wait days to get a response from Sun when I should be getting a reply in 4 hours.

Once, a while back, I burned Sun in a survey and that got a response from some higher up guy. I saved his contact information and have used it a couple of times since. Just this week I had to send an email to the support engineer listed for my case because it was over 24 hours and I hadn't heard anything.

The first time I contacted him was to get me linked back to the Online Support Center. For an unknown reason last August, Sun dropped me from the contracts for our company and I couldn't use online support to open or view cases. Nothing worked in getting it fixed. Even calling them and talking to them, they replied "sorry. nothing we can do." Finally after about 2 months, this guy got it fixed. Then lo-and-behold. It happened again in March. I couldn't get my name added back to the contracts. Finally, I contacted him again and he got it fixed.

The thing with Online Support is they can't even keep it straight. They have former employees on the contract that shouldn't be there. My manager sent the emails telling them he belonged as the contact but nothing worked.

Seems that since Sun stock is trading for less than a cup of Joe from Starbucks that Sun is trying to justify it and speed their demise.

 
Hey, I just had a thought. You say the shell specified in [tt]/etc/passwd[/tt] is not a valid shell. Say it's in there as [tt]/sbin/asdf[/tt]. Just do this...
Code:
cp /sbin/sh /sbin/asdf
chmod +x /sbin/asdf
echo "/sbin/asdf" >> /etc/shells
That gives a real and functional shell for that bad name in the [tt]/etc/passwd[/tt] file. Then just log in or [tt]su[/tt] to root.

Give it a try and let us know how it goes.
 
You should only add the bogus shell name to [tt]/etc/shells[/tt] if you already have this file. If not, you'll have to add all shell names to [tt]/etc/shells[/tt]. It limits which shells are considered valid. All shells are valid if the file doesn't exist.

Hmmm, what I posted above will only work if you have write access to where the bogus shell needs to go. Oh well.
 
that's true.. you could save a step or two by doing:
Code:
 ln -s /sbin/sh /sbin/sadf
The catch is sbin should be owned root and 755.. so only root would be able to make that link....the main reason I don't usually recommend that as a solution is those bin directories are usually unwriteable to anyone but root....
 
/etc/shells is read only....

I typed /sbin/ksh rather then /bin/ksh in the passwd file.

I tried creating a symbolic link between /sbin/ksh and /bin/ksh... tried copy a shell into /sbin/ksh...

The /sbin directory is read only.....

Thanks... Keep thinking... May hit something that works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top