root can't login, "login : CSH : No such file"

root can't login, "login : CSH : No such file"

Post by Fondula di Carcer » Thu, 17 Oct 2002 02:01:43



Hi all,

I did something stupid (part of the fun):

I was logged in as root and wanted to install bash as default shell, so I
used pkg_add to install the static package and afterwards I edited
/etc/shells.Now, when I logged out and back in as root, I still had csh as
shell.

So I tried doing 'usermod -s bash root' which returned that bash was not a
valid shell, so I said oops and did 'usermod -s csh root' which said csh was
not a valid shell. I wanted to log out and back in to see if the csh shell
was still ok, so I tried...

when logging in as root, the console just says 'login : CSH : No such file
or directory' and it throws me right back to the login prompt (and I began
feeling suspicious). Luckily I had another account in the wheel group, so I
logged in using that and I tried 'su' which returned 'su : CSH : No such
file or directory'. So I wanted to be smart and I tried 'sudo usermod -s
root' (which gave a funny message) and entered the root password (didn't
work, gave another funny message), tried the user password, which gave 'user
is not in the sudoers file'. So I did 'vi /etc/sudoers' and noticed that it
shouldn't be edited manual... I can't access /root either to put or modify a
shell
profile in there.

Now, I'm out of options... Any suggestions? All are welcome!
Thanks!

Sincerely,

 
 
 

root can't login, "login : CSH : No such file"

Post by Jan Bana » Thu, 17 Oct 2002 02:30:58


Somehow, I seem to recognize this problem :)

Try booting from an install floppy and mounting the / filesystem.
That way you'll be able to edit the files and put things right again :)

/Jan

On Tue, 15 Oct 2002 17:01:43 GMT

which I vaguely recall as:

> Hi all,

> I did something stupid (part of the fun):
[...]
> Now, I'm out of options... Any suggestions? All are welcome!
> Thanks!

> Sincerely,



 
 
 

root can't login, "login : CSH : No such file"

Post by Fondula di Carcer » Thu, 17 Oct 2002 02:37:43


Thanks for the swift reply, I'll give it a try!

Sincerely,



Quote:> Somehow, I seem to recognize this problem :)
> Try booting from an install floppy and mounting the / filesystem.
> That way you'll be able to edit the files and put things right again :)
> /Jan

 
 
 

root can't login, "login : CSH : No such file"

Post by tedu » Thu, 17 Oct 2002 02:36:48



> I was logged in as root and wanted to install bash as default shell, so I
> used pkg_add to install the static package and afterwards I edited
> /etc/shells.Now, when I logged out and back in as root, I still had csh as
> shell.

cue thorsten :).  you shouldn't be working as root, that's rule #1.  i've
never noticed root's shell, and i've never had this problem.  that's for
next time.

Quote:> So I tried doing 'usermod -s bash root' which returned that bash was not a
> valid shell, so I said oops and did 'usermod -s csh root' which said csh was
> not a valid shell. I wanted to log out and back in to see if the csh shell
> was still ok, so I tried...

/bin/csh is a valid shell.  shells alwasys have absolute paths.  valid
shells are listed in /etc/shells.

Quote:> file or directory'. So I wanted to be smart and I tried 'sudo usermod -s
> root' (which gave a funny message) and entered the root password (didn't

you enter your own password, as per the sudo man page.

Quote:> work, gave another funny message), tried the user password, which gave 'user
> is not in the sudoers file'. So I did 'vi /etc/sudoers' and noticed that it
> shouldn't be edited manual...

you could run the visudo command like it tells you with your open root
shell.  always leave a login active when making any change like this.

Quote:> I can't access /root either to put or modify a  shell
> profile in there.

that won't help.  you want to to fix the password database entry for root.
you can try to use usermod some more, or chsh or vipw.

Quote:> Now, I'm out of options... Any suggestions? All are welcome!

boot single user mode and clean up.  and know what you're doing before you
do it, especially as root.

type command, sit on hands, look at command, think about command, then
press enter.

--
Mediocrity is a sin.

 
 
 

root can't login, "login : CSH : No such file"

Post by Nathan Mat » Thu, 17 Oct 2002 04:20:18




Quote:>So I tried doing 'usermod -s bash root' which returned that bash was not a
>valid shell, so I said oops and did 'usermod -s csh root' which said csh was
>not a valid shell. I wanted to log out and back in to see if the csh shell
>was still ok, so I tried...

   Never do that. It's pretty risky to do what you're doing anyways;
if you insist on doing that, opening up a new console window
(Ctrl-Alt-F#) and try logging in to see if the change took effect is
*far* safer. [You're vulnerable to a freak power loss by tempting
Murphy's Law, but not logging out until you've proven it works is much
better.]

Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/  
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein

 
 
 

1. how 2 change this "hostname login:" to simple "login:"

Hi all,
how do you change the telnet prompt from "hostname login:" to a simple
"login:".  Thanks,

--Jacek

_______________________________________________
_______________________________________________

                       Jacek A. Ponarski
                 The University of Connecticut



fax  (203)427-2854

URL:         http://micro5.trincoll.edu/
GOPHER:             mareknt.pc.trincoll.edu
FTP:                mponarsk.pc.trincoll.edu

_______________________________________________

  To be or not to be, what was the question again?
_______________________________________________
_______________________________________________

2. NFS Trouble

3. "You must 'exec' login from the lowest login shell" - Problem !

4. linux on old DEC pc?

5. Why "login='exec login'"?

6. cannot install gcc

7. "Login" and "su" issue with root password

8. Help: setting up Diamond Viper 770, shows low res.

9. can't login as "root" from the lan or telnet

10. Can't login in as root - "no shell"

11. Can't login as "root" from the lan or telnet

12. can't login as root via "Reflection"

13. Path as "su" doesn't equal path as root or as login user