changing root shell prevents telnet

Help! I wanted to change the shell for root logins. I copied /etc/passwd to /etc/passwd.orig and vi'd the passwd file and changed the shell and home directories for root. I saved the file, logged out of the server and now I can't get back in. I remotely manage this server. Is there anyway to get back in to the box without going onsite and booting single user?

[370 byte] By [logirick] at [2007-11-26 10:17:17]
# 1

You might be able to get in as another user then "su root".

But if that doesnt work,,,

If its a box with an ALOM then you can telnet to the ALOM address and reboot single user from there.

As an aside, I wouldnt particularly recommend changing root shell or directory.

Log in as a normal user then user su or sudo or RBAC to get root privileges.

robertcohen at 2007-7-7 2:11:52 > top of Java-index,General,Talk to the Sysop...
# 2
As the previous poster suggested, don't directly log on as root. use su or sudo.If you really must, then I suggest leaving the shell in /etc/passwd alone, and using something like this in your profile:[ -x /bin/bash ] && /bin/bash
Reinder at 2007-7-7 2:11:52 > top of Java-index,General,Talk to the Sysop...
# 3
I'll bet you dollars for donuts that the new shell you gave to root isn't in /etc/shells. Bummer.And yeah: either try using "su" or "sudo" to fix the problem. If neither can be used, you're SOL and you'll need to boot into SUMode.
Cailin_Coilleach at 2007-7-7 2:11:52 > top of Java-index,General,Talk to the Sysop...
# 4
What does "can't get back in" mean? Do you just get login failed messages or some more explicit message like no shell?/etc/shells affects ftp access, but it does not affect telnet access. -- Darren
Darren_Dunham at 2007-7-7 2:11:52 > top of Java-index,General,Talk to the Sysop...
# 5
Darren,I sincerely doubt that /etc/shells is limited to FTP access only. The file defines all "valid user shells" on the system. Anyone trying to log into a shell that's not listed in the file is going to run into problems.
Cailin_Coilleach at 2007-7-7 2:11:52 > top of Java-index,General,Talk to the Sysop...
# 6

> I sincerely doubt that /etc/shells is limited to FTP

> access only. The file defines all "valid user shells"

> on the system. Anyone trying to log into a shell

> that's not listed in the file is going to run into

> problems.

Not on a default installation.

$ ssh testuser@jumpy

testuser@jumpy's password:

Last login: Wed Oct 4 15:35:28 2006 from 10.254.1.6

Could not chdir to home directory /export/home/testuser: No such file or directory

jumpy% echo $SHELL

/bin/oddshell

jumpy% grep testuser /etc/passwd

testuser:x:1008:1:Shell test:/export/home/testuser:/bin/oddshell

jumpy% cat /etc/shells

/bin/bash

/sbin/sh

jumpy% ls -l /bin/oddshell

lrwxrwxrwx1 rootother 3 Oct 4 15:35 /bin/oddshell -> csh

jumpy% id

uid=1008(testuser) gid=1(other)

jumpy% uname -rvp

5.8 Generic_108528-27 sparc

Same behavior on Solaris 10. In addition, while not present in the Solaris 8 manual page, the Solaris 10 manual page has this note.

File Formatsshells(4)

[snip]

Invalid shells in /etc/shells may cause unexpected behavior

(such as being unable to log in by way of ftp(1)).

Non-default authentication schemes in PAM may also read it, but you'd have to modify the system to make that happen.

--

Darren

Darren_Dunham at 2007-7-7 2:11:52 > top of Java-index,General,Talk to the Sysop...