*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-13-2009, 04:06 AM
|
#1
|
|
Member
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221
Rep:
|
How to change the default login Shell in FreeBSD
I have a FreeBSD machine.
I have a user called 'test'. Under '/etc/passwd' file, I have set the login shell for that user to '/usr/local/bin/bash'
However when I am doing, 'su - test', I am being taken to 'C Shell' (csh).
The reason seems to be that enviromental variable "SHELL" for the test user is set to "C Shell",
How can I permanently change the "SHELL" variable and set it to "BASH" shell.
|
|
|
|
04-13-2009, 04:41 AM
|
#2
|
|
Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
Have you tried running "chsh -s /usr/local/bin/bash" whilst logged in as the user?
|
|
|
|
04-13-2009, 06:57 AM
|
#3
|
|
Member
Registered: May 2007
Distribution: FreeBSD
Posts: 110
Rep:
|
You can achieve this by many ways:
1) google
2) edit /etc/master.password , edit the users line, and change the part where it states the login absolute shell path
3) like reddazz sayd (chsh)
4) pw usermod <user> <changes> (read man for this) [ex: pw usermod <user> -s /bin/bash ]
5) google
6) on solaris there is "passwd -e" but doesn't work on F-BSD
aaa, isn't BSD family nice. It allowes you to do whatever you like, in so many different ways 
|
|
|
|
04-13-2009, 07:44 AM
|
#4
|
|
Member
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 371
Rep:
|
Quote:
|
2) edit /etc/master.password , edit the users line, and change the part where it states the login absolute shell path
|
Always use vipw(8) for that.
|
|
|
|
04-13-2009, 03:46 PM
|
#5
|
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD, Ubuntu (desktop)
Posts: 3,859
Rep: 
|
Also note that you have to actually install the shells/bash port (if you haven't already).
See the manpages for chpass(1). On FreeBSD systems, chpass is hardlinked to chsh, BTW.
Code:
> ls -i /usr/bin/chpass /usr/bin/chsh
212201 /usr/bin/chpass 212201 /usr/bin/chsh
|
|
|
|
04-13-2009, 04:23 PM
|
#6
|
|
Member
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 474
Rep:
|
Quote:
Originally Posted by paragkalra
I have a FreeBSD machine.
I have a user called 'test'. Under '/etc/passwd' file, I have set the login shell for that user to '/usr/local/bin/bash'
However when I am doing, 'su - test', I am being taken to 'C Shell' (csh).
The reason seems to be that enviromental variable "SHELL" for the test user is set to "C Shell",
How can I permanently change the "SHELL" variable and set it to "BASH" shell.
|
add /usr/local/bin/bash to the /etc/shells file.
|
|
|
|
04-16-2009, 02:40 AM
|
#7
|
|
Member
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221
Original Poster
Rep:
|
Thanks reddazz...your solution worked like a charm...also thanks to rest of the guys for sharing your opinions...
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:14 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|