Operating System - HP-UX
1831651 Members
2022 Online
110029 Solutions
New Discussion

Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

 
Muthyala
Frequent Advisor

Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Hi
By mistake the default shell access of root has been changed from /usr/bin/ksh to /usr/sh. Due to this i am not able to login thru root, I get error stating that no shell found. It is secure system with no other user has access privilege of root. How to solve this issue? In case i boot the server in single user mode, can I login and access the /etc/passwd file since the shell for root is wrong.
TIA
Sri
9 REPLIES 9
Yang Qin_1
Honored Contributor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Hi, I think you meant "default shell of root has been changed from /ubin/sh to /usr/bin/ksh", right?

Can you try to ftp to that server, "get" passwd, modify it and then "put" it back.

Otherwise, can you find a backup tape which contain good /etc/passwd, so that you can restore passwd from that tape?

Don't reboot the server, you may have problem to start it unless you use Ignite backup to recovery your serv server

Yang
Christian Tremblay
Trusted Contributor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

"no other user has access privilege of root"

You mean that logging in as a regular user and su to root login doesn't work ?
Muthyala
Frequent Advisor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Hi

I have copy of good passwd file but cannot copy it because the access is all r-r-r only and also I have enabled SFTP with root access denied; Due to this i cannot ftp the modified to /etc.

I can login thru other users but cannot su to root, it gives me error no shell and logs me out.

What will happen if i reboot in single user mode, will it come to # prompt OR the system will have problem to boot because of invalid shell mentioned in /etc/passwd file.


Thanks
Sri
Coolmar
Esteemed Contributor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Can you su to root like:

# su root

NOT

#su - root

I though when you don't have the (-) then you avoid the shell....
Muthyala
Frequent Advisor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Hi

Both the ways #su root and #su - root i get error "

$ su root
Password:
Last successful login for root: Wed Nov 22 11:00:34 MST7MDT 2006 on console
Last unsuccessful login for root: Tue Nov 21 11:22:23 MST7MDT 2006 on pts/3
su: No shell
server:/home/user1 $ su - root
Password:
Last successful login for root: Wed Nov 22 11:12:36 MST7MDT 2006 on console
Last unsuccessful login for root: Tue Nov 21 11:22:23 MST7MDT 2006 on pts/3
su: No shell
Christian Tremblay
Trusted Contributor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

This is a longshot and I don't have a system to test if it works or not, but you may try to setup a link like this:

ln -s /usr/bin/ksh /usr/sh

and try to su or login..
Muthyala
Frequent Advisor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Hi

I have tried doin ln -s but i dont privilage.

Thanks
Sri
Muthyala
Frequent Advisor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd

Hi

Solved this issue by running SAM thru login has normal user and executing the following command
$/usr/dt/bin/dtaction Sam

this will start in sam by asking the root password , once u give the root password sam comes up.Then you can edit the user root and change the login shell.

If u dont have CDE then u need to export u r display variable to run SAM.

Thanks
Sri
Muthyala
Frequent Advisor

Re: Root Access is Denied - Wrong Shell Mentioned in /etc/passwd



Solved this issue by running SAM thru login has normal user and executing the following command
$/usr/dt/bin/dtaction Sam

this will start in sam by asking the root password , once u give the root password sam comes up.Then you can edit the user root and change the login shell.

If u dont have CDE then u need to export u r display variable to run SAM.

Thanks
Sri