Can't login to the system...!

Jerry McAllister jerrymc at
Thu Jul 23 17:27:47 UTC 2009

On Thu, Jul 23, 2009 at 04:56:35PM +0300, thanos trompoukis wrote:

> Hi all, I am a noobie here.
> I was in the system as root and I type this command:
> chsh -s usr/local/bin/bash (without reason,by mistake)
> when I reboot the system I give username & password  and I see this:
> login:  usr/local/bin/bash:  No such file or directory

OK.   The first thing I see is that bash is probably
at  /usr/local/bin/bash   and not  usr/local/bin/bash
Note the missing leading '/' in your command and in the
error message.

The second thing I notice is that you are trying to change
the shell for root, and that is generally unadvisable.
Although it is possible and most things will have no problems,
the times the problems will come up is when you need to 
boot to single user to fix some crash causing problem and you
do not have the /usr/local/bin available to you.

So, just leave root's shell as /bin/csh  

If you just have to work in a root level and use bash, then make 
another id that is root and makes its shell be bash.

The toor account is available and can be used for that or, if you
don't like that name, you can duplicate that line in the /etc/passwd 
file using   vipw(8)  and then edit the id to be something you 
like - such as Rthanos  maybe - and also edit the login directory to 
be  /root/Rthanos   (or whatever you made that new id) (The prepended 'R' 
in the name reminds you it is a root account.   Set a password for that 
account.  Log in to that new root account directly if you are working 
on the console, or log in to your regular non-root account if you are 
working remotely and su to that new account instead of plain root.

NOTE: One thing to be careful of:   Since the UID of both accounts
      will be 0, when you use root to set the password, you must
      specifiy the account name (Rthanos) on the 'passwd' command
      or it will set the first root account it finds since it goes
      by UID and you would accidently reset the root password
      and not the Rthanos password.   

By the way, leave root as the first entry in the /etc/passwd file.
Put your new one after toor if you don't use toor.


> FreeBSD/i386  (leonidas.MSHOME) (ttyv0)
> login:
> But I can access the system as another user, and
> when I type *su* I can login as root fine.
> I have no idea what i've done. Give me your lights please.
> Thanx!
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list