Re: Can't login to the system...!

2009-07-23 Thread Jerry McAllister
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.

jerry


> 
> 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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Can't login to the system...!

2009-07-23 Thread Steve Bertrand
Steve Bertrand wrote:
> 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)
> 
> Login as a different user, and "su" to root as you've stated you can do,
> then:
> 
> # chsh -s /bin/sh

...that's a typo that was to be "/bin/csh", which is the shell that I use...

Steve


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Can't login to the system...!

2009-07-23 Thread Daniel Bye
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
> 
> 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.

You mangled the path to bash in the chsh command - note the absense of a 
leading / 

Become root using su, then change your root shell back to /bin/tcsh:

 # chsh -s /bin/tcsh 

All should now be well. 

Dan

-- 
Daniel Bye
 _
  ASCII ribbon campaign ( )
 - against HTML, vCards and  X
- proprietary attachments in e-mail / \


pgpB2GKHQLZTp.pgp
Description: PGP signature


Re: Can't login to the system...!

2009-07-23 Thread Steve Bertrand
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)

Login as a different user, and "su" to root as you've stated you can do,
then:

# chsh -s /bin/sh

Steve


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Can't login to the system...!

2009-07-23 Thread Polytropon
On Thu, 23 Jul 2009 16:56:35 +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
> 
> 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.

Just change back the shell to the standard dialog shell,
which is the C shell /bin/csh. If you intendedly want to
use a different shell when working as root, consider using
the toor account and change the shell of toor. Do not change
the shell of root.

Login as any user. Then:

% su root
Password:
# chsh
... change back to csh ...
# exit
% exit

Now you can login as root again.

Note that you missed the leading / in the BASH name, as
the login message states:

> login:  usr/local/bin/bash:  No such file or directory
 ^

The correct path is /usr/local/bin/bash. And you can use
this path for toor, no problem at all.




-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Can't login to the system...!

2009-07-23 Thread thanos trompoukis
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

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@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"