LinuxQuestions.org
Visit Jeremy's Blog.
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 09-19-2004, 05:23 PM   #1
frankie_DJ
Member
 
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Rep: Reputation: 30
changed root's shell accidentally


huh...I don't know if you've seen this one before.

I just installed Slackware 10.0 a week ago and I am still battling basic stuff.
I accidentally (by logging in as 'su' and then forgetting about it) changed root's login shell to ksh. Now I can't login as root anymore!!!
Actualy I can, but I get immediatelly kicked out. As soon as I login it gives me:

Cannot execute ksh; No such file or directory

and kicks me out.

Is there a way to fix this?
 
Old 09-19-2004, 05:41 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,131

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Try going in with 'su' (not su - so you don't get root's environment) and editing /etc/passwd to provide the full correct path to the shell. If that doesn't work, you'll need to boot into signle user mode to do the same thing.
 
Old 09-19-2004, 06:23 PM   #3
frankie_DJ
Member
 
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Original Poster
Rep: Reputation: 30
HUh....The first thing doesn't work - I get the same message. I booted into the SU mode and tried to edit the file but it wouldn't let me - I think because I was logged in as a regular user (that's the onlly way I can log in).
 
Old 09-19-2004, 06:43 PM   #4
bornhj
Member
 
Registered: Sep 2004
Location: Canberra, Australia
Distribution: Fedora Core 3, Ubuntu Hoary, Slack 10.1
Posts: 120

Rep: Reputation: 15
Not using Slackware, I can't offer advice on it. But, with Fedora 2, CD1 includes a rescue mode. If you login to that, you can edit files on your system without booting it. Also, I'm not sure if it would work, but if you can get your hand on a CD based distro like Knoppix you could probably edit from there.
 
Old 09-19-2004, 06:59 PM   #5
frankie_DJ
Member
 
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Original Poster
Rep: Reputation: 30
Well I just booted from my boot floppy. But...I am still not allowed to edit /etc/passwd. Am I doing it right?
Reboot with the floppy, mount with read-write option, login as a user...

Bornhj, is this the same way I'd do it with CD?
 
Old 09-19-2004, 07:36 PM   #6
bornhj
Member
 
Registered: Sep 2004
Location: Canberra, Australia
Distribution: Fedora Core 3, Ubuntu Hoary, Slack 10.1
Posts: 120

Rep: Reputation: 15
Fedora's rescue CD automatically assigns you root permissions in rescue mode.

If Slackware has this same function on one of it's CDs, then you should be able to type something like 'linux rescue' at the prompt (if it has one) and this will give you root permissions at a bash (or sh) shell.

(I am a newbie to Linux too, just discovered rescue mode when I had to edit my xorg.conf file, then i realised I could go to runlevel 3 from Grub)

[EDIT: Solution from MasterC below. Thanks ]

Last edited by bornhj; 09-19-2004 at 07:45 PM.
 
Old 09-19-2004, 07:40 PM   #7
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
You ought to be able to boot with your slack CD or any of the millions of Live CD's available and mount up the / partition (or wherever /etc is located) to a /mnt directory and then edit /etc/passwd to your liking.

Cool
 
Old 09-19-2004, 11:28 PM   #8
frankie_DJ
Member
 
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Original Poster
Rep: Reputation: 30
coooool :-)))

it worked out. had to learn a little bit of vi cause it was the only editor available (i thought
i'd leave vi for latter. ya, right!)

thank u guys for the help.

man, this thing is such an awesome toy, i could play with it forever. except that i have to go to stupid work tomorrow #$%^%$# !
 
  


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
accidentally changed permissions on home folder Cinematography Linux - General 7 05-15-2005 04:32 AM
my shell changed to bash-3-00$ ???? johnnydangerous Fedora 2 03-28-2005 08:00 AM
Stupid mistake - changed root shell to /bin/false Kholnuu Linux - General 8 01-04-2005 03:48 AM
how to get root's right in my program icoming Programming 8 09-06-2004 02:29 AM
changed the login shell in /etc/passwd to the wrong path infamous41md Solaris / OpenSolaris 3 07-03-2004 07:32 PM


All times are GMT -5. The time now is 10:55 PM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration