Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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).
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'?
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 ?
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.