LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 02-20-2008, 06:01 PM   #1
LinuxBaby
LQ Newbie
 
Registered: Feb 2008
Posts: 3

Rep: Reputation: 0
SUSE - Root Shell accidentally set to /bin/false


Hi guys,

I got an urgent problem with SUSE Linux.

I accidentally set root shell to /bin/false. Hence, when I logged out, I can't access back to the Root Super User. I can still work with the server but I can't access to root.

Anything I can do to return this to /bin/bash?

Hope you could help me.

Thanks!

Last edited by LinuxBaby; 02-20-2008 at 06:02 PM.
 
Old 02-20-2008, 06:04 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
Try hitting escape at the grub screen, and edit the suse starup by putting single at the end of the kernel line. Boot, then edit /etc/passwd. I assume this works, unless the partition is mounted readonly.

If it is, boot a live CD, then mount the sus partition and make the change to passwd
 
Old 02-20-2008, 06:35 PM   #3
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
I don't think "single" would work. That would use the system directories and root's shell would still be /bin/false.

You could try the "rescue" boot option or "init=/bin/bash". The latter will drop you into the shell as root. For both of these, you will need to mount the root directory to access the regular /etc/passwd file.
 
Old 02-20-2008, 06:39 PM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 98
Are you able to login as a different user?

If so, you can run

Code:
su -s /bin/bash
And then fix your problem.

HTH

Forrest

Never mind, that wont work. But, let us know if you can get a different user.

Last edited by forrestt; 02-20-2008 at 06:45 PM.
 
Old 02-20-2008, 07:00 PM   #5
LinuxBaby
LQ Newbie
 
Registered: Feb 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by forrestt View Post
Are you able to login as a different user?

If so, you can run

Code:
su -s /bin/bash
And then fix your problem.

HTH

Forrest

Never mind, that wont work. But, let us know if you can get a different user.


Yes I can still log to different user. Ok I'll try this later.

Thanks!
 
Old 02-20-2008, 07:16 PM   #6
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Yeah, no worries. You are still okay. Worse case is get a live boot CD like Knoppix, mount the partition, and then modify the /etc/fstab for root.
 
Old 02-20-2008, 07:30 PM   #7
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 98
You don't need to modify the /etc/fstab, just modify the /etc/passwd file. If you have a user with sudo privileges, then you can fix it with "sudo vi /etc/passwd" (or whatever editor you like).

HTH

Forrest
 
Old 02-21-2008, 09:50 AM   #8
LinuxBaby
LQ Newbie
 
Registered: Feb 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by LinuxBaby View Post
Yes I can still log to different user. Ok I'll try this later.

Thanks!
This worked! Many thanks!
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Created set of users w/ /bin/true shell, changed show and can't get in via SSH lsgko Ubuntu 1 02-08-2008 07:23 AM
Accidentally Linked /usr/bin to /bin... worldgnat Linux - Software 2 04-01-2006 06:51 PM
problems with /bin/false reactnet Slackware 5 08-29-2005 10:19 PM
Stupid mistake - changed root shell to /bin/false Kholnuu Linux - General 8 01-04-2005 03:48 AM
root /bin/false problem kaboom Linux - Newbie 6 10-24-2003 07:38 AM


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

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration