root /bin/false problem
Yep, this is very stupid :(
I changed in /etc/passwd the root user in /bin/false. But i forgot to give myself root rights and i can't become root anymore. The server is in my networkcentre and is it possible for me to become root again? I know the root password ofcourse and i can login with my normal user (ssh). Can someone please help me? Thanks! |
I don't know exactly what you've done, but you should be able to reboot in single user mode and edit the passwd entry for root. Search this forum for more info on doing this.
Do you mean you've changed the chown for the file /bin/false? What happens when you type 'ls -l /bin/false'? Dave |
I can login with a different user but this user has no rights in /etc/passwd to change the root user back in /bin/bash
ls -la /bin/bash gives me: -rwxr-xr-x 1 root root /bin/bash |
Hi,
Have you set up sudo on the server for yourself or any other user. If you have you should be able to login to the server as that user then give the command prompt> sudo vi /etc/password and give your user password when asked. I think this should work, as I don't think it depends on the root entry in the password file although it depends on sudo having been set up. If that does not work you can try su ie prompt >su root > vi /etc/pasword root ><Cntl-d> However I think that this does depend on the password entry for root so it may not help much. If these both fail then it will probably mean that you will have to boot the server into single user /rescue mode and make the changes from there. Wouldn't it be safer just to pick a password that no one else knows for root ? Stv T |
Hi Again,
|
Hi Again again,
Hit the wrong key on the last post - My previous reply assumes that you changed the shell in the password file for /bin/false to prevent anyone logging in as root. ie changed root:x:0:0:root:/root:/bin/bash to root:x:0:0:root:/root:/bin/false The permissions on '/bin/bash' are correct they don't need to change. If neither of the previous suggestions work then no user will be able to correct it and you will have to boot into rescue/single user mode Stv T |
STV thankyou very much but i already did both with no succes :(
And yes indeed this is what i changed: root:x:0:0:root:/root:/bin/bash to root:x:0:0:root:/root:/bin/false |
All times are GMT -5. The time now is 03:58 PM. |