LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-01-2005, 11:13 PM   #1
Kholnuu
LQ Newbie
 
Registered: Dec 2004
Posts: 20

Rep: Reputation: 0
Stupid mistake - changed root shell to /bin/false


Wasn't paying attention to which terminal I was typing in, and instead of changing the shell of a test account, I changed root's shell to /bin/false.

Now I can't log into root, can't su into root, can't do anything with the root account. That's bad.

What's worse is that I'm not located anywhere near the computer. I can probably fix this issue with Knoppix when I get home, but that will be some time from now.

Is there a way I can fix this remotely?

Thanks in advance for any help anybody can provide, and excuse my idiocy.
 
Old 01-01-2005, 11:32 PM   #2
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
Not that I can think of Some type of LiveCD locally will be your best bet.
 
Old 01-02-2005, 02:47 AM   #3
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

do you have
Code:
/etc/sudoers
configured?
you could mess with 'sudo'. you can execute commands with 'root' right without shell invoking.
i don't see any other chance, considering that you are with remote access.

regards
slackie1000
 
Old 01-02-2005, 03:42 AM   #4
Kholnuu
LQ Newbie
 
Registered: Dec 2004
Posts: 20

Original Poster
Rep: Reputation: 0
I didn't have sudo installed, no, but I downloaded the package. I'll install it once I get root access back.

Looks like my only plan is to wait until I can get back to the machine, boot up on my recovery CD, mount the harddrive, and edit from there.

Ah well.
 
Old 01-02-2005, 02:32 PM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
No need ... use su with the -s option. That lets you specify which shell to use, overriding the entry in /etc/passwd.
 
Old 01-02-2005, 05:55 PM   #6
Kholnuu
LQ Newbie
 
Registered: Dec 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by btmiller
No need ... use su with the -s option. That lets you specify which shell to use, overriding the entry in /etc/passwd.
I believe you mean: su -s /bin/bash or something similar? I get the prompt for the root user, but then get immediately dumped back to the original account I was in.

http://www.rt.com/man/su.1.html

Quote:
-s, --shell shell
Run SHELL instead of USER's shell from /etc/passwd,
unless the user running su is not the superuser and
USER's shell is restricted
If I had screwed up any account other than root, I'd be good to go.
 
Old 01-03-2005, 03:31 AM   #7
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
Quote:
Originally posted by Kholnuu
I believe you mean: su -s /bin/bash or something similar? I get the prompt for the root user, but then get immediately dumped back to the original account I was in.

http://www.rt.com/man/su.1.html



If I had screwed up any account other than root, I'd be good to go.
no. you don't screw up with another user!

AFAIK, the '-s' option does not work if you are trying with a non-root user.

cheers,

slackie1000
 
Old 01-03-2005, 04:52 AM   #8
n0sr
Member
 
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255

Rep: Reputation: 34
I looked at that man page link, did you try the "command" option?

Code:
su --command=passwd
Might try that, but as I read the man page it sounds like the command may not be run interactively.
 
Old 01-04-2005, 03:48 AM   #9
n0sr
Member
 
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255

Rep: Reputation: 34
Quote:
Originally posted by n0xvb
I looked at that man page link, did you try the "command" option?

Code:
su --command=passwd
Might try that, but as I read the man page it sounds like the command may not be run interactively.
OK, I did a test on my system and got this command to work successfully:
Code:
su -c passwd
This is on a Slack system.
 
  


Reply



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 On
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
Big stupid Bad Mistake... GRUB dasz Linux - Software 7 12-09-2004 09:35 AM
root /bin/false problem kaboom Linux - Newbie 6 10-24-2003 07:38 AM
Stupid Mistake, WPC54G, not WPC11 Rv5 Red Hat 1 09-02-2003 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:00 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
Open Source Consulting | Domain Registration