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.
# 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
# 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