LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-24-2003, 03:28 AM   #1
kaboom
Member
 
Registered: Aug 2003
Posts: 36

Rep: Reputation: 15
Question 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!
 
Old 10-24-2003, 05:04 AM   #2
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
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

Last edited by davee; 10-24-2003 at 05:06 AM.
 
Old 10-24-2003, 05:19 AM   #3
kaboom
Member
 
Registered: Aug 2003
Posts: 36

Original Poster
Rep: Reputation: 15
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

Last edited by kaboom; 10-24-2003 at 05:21 AM.
 
Old 10-24-2003, 06:56 AM   #4
stv_t
Member
 
Registered: Oct 2003
Location: Gatwick, UK
Distribution: Mandrake 9.1, Mandrake 9.2, Redhat 9.0
Posts: 47

Rep: Reputation: 15
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
 
Old 10-24-2003, 06:57 AM   #5
stv_t
Member
 
Registered: Oct 2003
Location: Gatwick, UK
Distribution: Mandrake 9.1, Mandrake 9.2, Redhat 9.0
Posts: 47

Rep: Reputation: 15
Hi Again,
 
Old 10-24-2003, 07:37 AM   #6
stv_t
Member
 
Registered: Oct 2003
Location: Gatwick, UK
Distribution: Mandrake 9.1, Mandrake 9.2, Redhat 9.0
Posts: 47

Rep: Reputation: 15
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
 
Old 10-24-2003, 07:38 AM   #7
kaboom
Member
 
Registered: Aug 2003
Posts: 36

Original Poster
Rep: Reputation: 15
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

Last edited by kaboom; 10-24-2003 at 07:46 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with /bin/false reactnet Slackware 5 08-29-2005 10:19 PM
SSH Problem /bin/false ultrix Linux - Security 2 06-17-2005 07:31 AM
Stupid mistake - changed root shell to /bin/false Kholnuu Linux - General 8 01-04-2005 03:48 AM
problem with installing PostgreSQL . Configuring false with Java kernelvn Linux - Software 0 08-30-2004 04:15 AM
Debian installation - root.bin Bamse123 Linux - Newbie 7 10-27-2003 05:35 AM


All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration