1752794 Members
6097 Online
108789 Solutions
New Discussion юеВ

su: No shell

 

su: No shell

#su -
su: No shell
Segmentation fault

#vi /etc/passwd
root:TlhWDUMmhUbG6:0:3::/:/sbin/tcsh
-> not login
lbs:AO21eh5Sbv6MI:2000:101:LBS,,,:/data6/lbs:/usr/bin/tcsh
-> login

#ftp 192.168.0.3
Name (192.168.0.3:lbs): root
530 User root access denied...
Login failed.

#ftp 192.168.0.3
Name (192.168.0.3:lbs): lbs
230 User lbs logged in.

#rcp /tmp/passwd 192.168.0.3:/etc/passwd
remshd: /sbin/tcsh: No such file or directory

remote Server

please help me.
11 REPLIES 11
Dennis Handly
Acclaimed Contributor

Re: su: No shell

>root:TlhWDUMmhUbG6:0:3::/:/sbin/tcsh

You must never ever do this. The only shell for root is /sbin/sh. Except no substitutes!

After you login, you could invoke tcsh.
The above errors indicate that /sbin/tcsh may not exist at all?

Re: su: No shell

#pwck

root:TlhWDUMmhUbG6:0:3::/:/sbin/tcsh
Optional shell file not found
Invalid root shell
Jeeshan
Honored Contributor

Re: su: No shell

change the shell using vipw command. don't use vi to edit /etc/passwd file.

#vipw
a warrior never quits
Venkatesh BL
Honored Contributor

Re: su: No shell

>#vi /etc/passwd
> root:TlhWDUMmhUbG6:0:3::/:/sbin/tcsh
-> not login
>lbs:AO21eh5Sbv6MI:2000:101:LBS,,,:/data6/lbs:/usr/bin/tcsh
>-> login

Looks like '/sbin/tcsh' is not available of the system (try '11 /sbin/tcsh' command). I think its recommended that you use '/sbin/sh' instead (as proposed by Dennis already).


Re: su: No shell

#vipw
lckpwdf: Permission denied
vipw: Cannot obtain lock for /etc/.pwd.lock
Patrick Wallek
Honored Contributor

Re: su: No shell

Check for the /etc/pwd.lock file. If it's there, remove it.
Jeeshan
Honored Contributor

Re: su: No shell

ok then. use command

#usermod -s root /sbin/sh
a warrior never quits

Re: su: No shell

#rm -rf .pwd.lock
rm: .pwd.lock Permission Denied
#usermod -s root /sbin/sh
Permission Denied
Dennis Handly
Acclaimed Contributor

Re: su: No shell

>rm: .pwd.lock Permission Denied

Are you root? What does id(1) show?
If you aren't root, you will have to go into single user mode.

>Venkatesh: I think it's recommended that you use '/sbin/sh' instead

This is NOT just a recommendation, this is a hard requirement.