Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Dec 2000 09:16:55 -0800
From:      "Kevin Oberman" <oberman@es.net>
To:        Andrey Mavrichev <mavrichev@yahoo.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: shell 
Message-ID:  <200012111716.eBBHGtJ31143@ptavv.es.net>
In-Reply-To: Your message of "Sun, 10 Dec 2000 18:16:55 EST." <3A340EE7.1FD53D3D@yahoo.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Sun, 10 Dec 2000 18:16:55 -0500
> From: Andrey Mavrichev <mavrichev@yahoo.com>
> Sender: owner-freebsd-questions@FreeBSD.ORG
> 
> Hi!
> 
> I have installed a FreeBSD on my computer two days ago, and I am new at
> this. While attempting to change the shell (from csh to tcsh) that is
> loaded for root, I made a mistake. I used the "vipw" command, and
> accidently typed "kcsh" instead of "tcsh" (a stupid mistake, I know). I
> realized this only after I saved and rebooted the system - and it was
> too late. I do not have any other users through which I can get into the
> system, and logging as a root only gives an error message that it can't
> find the "kcsh" shell. I tried the installation boot floppies to get
> into the setup utility, but this didn't work.
> 
> Can you suggest any methods other than re-installation of the system
> that can be used to start the proper shell and correct the mistake? Are
> there any login commands or options that can be used to start a shell,
> or is there any way to get into the set-up utility?

Sure. Just boot into single-user mode and re-edit the file. (Single
user mode will default to sh as the shell.)

To get into single-user mode, re-boot the system (CTRL-ALT-DEL should
cleanly shut down the system without you needing to log in). When you
get the message to hit return to boot up, press another key (like
space). You will get a prompt. Enter the command "boot -s". You will
be asked which shell you want to use. Just hit return for sh. Then
fsck the root ("fsck -p") and mount the file systems for r/w access
("mount -u /" and "mount -a"). Now you can vipw and edit the shell.

But changing the login shell from csh to tcsh is a waste of time as
both are the same under V4.

> ls -l /bin/csh /bin/tcsh
-r-xr-xr-x  2 root  wheel  625476 Nov 25 05:11 /bin/csh
-r-xr-xr-x  2 root  wheel  625476 Nov 25 05:11 /bin/tcsh

R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012111716.eBBHGtJ31143>