Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Can not login as root remotely and in the console/server

monster00
Advisor

Can not login as root remotely and in the console/server

I can't login as root remotely and on server. when i try to login as a different user, it is successful but when i tried root and key in the passwd - (su - root) it says su: no shell

what to do? please help!
31 REPLIES
Suraj K Sankari
Honored Contributor

Re: Can not login as root remotely and in the console/server

Hi,

Do you have any root equivalents user on your system? If yes then login with that user

Suraj
monster00
Advisor

Re: Can not login as root remotely and in the console/server

nothing
Kapil Jha
Honored Contributor

Re: Can not login as root remotely and in the console/server

Just check is you have correct entried in /etc/securetty
and if in root passwd if you have special character use "\" before it.
eg if passwd is abc!@#
enter abc\!\@\#
WOuld help I suppose.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Bart Paulusse
Respected Contributor

Re: Can not login as root remotely and in the console/server

when you do a cat /etc/passwd is the default shell for user root still valid?
The su: No shell message means that su can't find the default shell mentioned in the passwd file.

If the default shell for user root points to a non existing file, try to create a link there that points to an existing shell.
The fix the passwd file and remove the link.
If /sbin/sh (usualy root's default shell) is gone, you may be getting more issues. That shouln;t "dissapear"

regards,

Bart
monster00
Advisor

Re: Can not login as root remotely and in the console/server

i have not /etc/securetty file.
monster00
Advisor

Re: Can not login as root remotely and in the console/server

root:F/RO/8Au5Hd16:0:3::/:/sbin/sh
Bart Paulusse
Respected Contributor

Re: Can not login as root remotely and in the console/server

What does "ls -l /sbin/sh" return?
monster00
Advisor

Re: Can not login as root remotely and in the console/server

-r-xr-xr-x 1 bin bin 1402088 Feb 16 2007 /sbin/sh
monster00
Advisor

Re: Can not login as root remotely and in the console/server

this is what it display


$ su - root
Password:
su: No shell
$
Bart Paulusse
Respected Contributor

Re: Can not login as root remotely and in the console/server

What happens when you start /sbin/sh
Does that return any errors?
Bart Paulusse
Respected Contributor

Re: Can not login as root remotely and in the console/server

Is /sbin/sh listed in file /etc/shells ?
monster00
Advisor

Re: Can not login as root remotely and in the console/server

is it like exec /sbin/sh ??
monster00
Advisor

Re: Can not login as root remotely and in the console/server

dont have /etc/shells
Bart Paulusse
Respected Contributor

Re: Can not login as root remotely and in the console/server

Try to start /shin/sh by just entering /sbin/sh
Create file /etc/shells with contents:
/sbin/sh
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/usr/bin/rksh
/usr/bin/csh
/usr/bin/keysh

this is the same list of valid shells the system wil use if no /etc/shells file is present but it can't hurt to try...

Have you setup sudo on your system?
If yes, try to sudo vi /etc/passwd, change root's shell to the one that is working for your current user. When you can su to root then, run a "swverify \*"

Remember to set root's shell back to /sbin/sh this is very important!
monster00
Advisor

Re: Can not login as root remotely and in the console/server

can't create /etc/shells coz its not root..
can't write under /etc

haven't set up sudo...

Suraj K Sankari
Honored Contributor

Re: Can not login as root remotely and in the console/server

Hi,

Don't you have console access ?
If not ask some one to create that file (/etc/shell) who is access to console.

Suraj
monster00
Advisor

Re: Can not login as root remotely and in the console/server

i think not.. only the root has an access right.. so does it mean i have to reinstall the OS?
Robert-Jan Goossens
Honored Contributor

Re: Can not login as root remotely and in the console/server

could you post the output of

# file /sbin/sh
# file /usr/bin/sh

Regards,
Robert-Jan
monster00
Advisor

Re: Can not login as root remotely and in the console/server

$ file /sbin/sh
/sbin/sh: ELF-32 executable object file - IA64
$ file /usr/bin/sh
/usr/bin/sh: ELF-32 executable object file - IA64


thanks
Bart Paulusse
Respected Contributor

Re: Can not login as root remotely and in the console/server

You can try to boot into single user mode. If you can logon as root then, try to vi /etc/passwd. There might be a problem with your /etc/passwd file, special character or something like that.
Suraj K Sankari
Honored Contributor

Re: Can not login as root remotely and in the console/server

Hi,
root can login from console
so if you have console access then try from console.

Suraj
monster00
Advisor

Re: Can not login as root remotely and in the console/server

hi can't login.. same result as logging in remotely...


no shell

avizen9
Esteemed Contributor

Re: Can not login as root remotely and in the console/server

Hello Monster00,

can you please try to boot this server/station in single user mode, once you done,

create a new account with 0:3 with /sbin/sh shell (owner =0 and group =3) to just verify the issue, you may just add this acccount in /etc/passwrd file

and then try to login with new created account. what will be result. let us know.
monster00
Advisor

Re: Can not login as root remotely and in the console/server

i already sign in single user mode
changed the root password.
how to create a new account? /usr/sbin/sam is not working...


tried logging in using the new passwd. still not working