LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 04-13-2009, 04:06 AM   #1
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Rep: Reputation: 31
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.
 
Old 04-13-2009, 04:41 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Have you tried running "chsh -s /usr/local/bin/bash" whilst logged in as the user?
 
Old 04-13-2009, 06:57 AM   #3
da1
Member
 
Registered: May 2007
Distribution: FreeBSD
Posts: 110

Rep: Reputation: 16
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
 
Old 04-13-2009, 07:44 AM   #4
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 397

Rep: Reputation: 81
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.
 
Old 04-13-2009, 03:46 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
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
 
Old 04-13-2009, 04:23 PM   #6
rocket357
Member
 
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 476
Blog Entries: 117

Rep: Reputation: 74
Quote:
Originally Posted by paragkalra View Post
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.
 
Old 04-16-2009, 02:40 AM   #7
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
Thanks reddazz...your solution worked like a charm...also thanks to rest of the guys for sharing your opinions...
 
  


Reply

Tags
freebsd, login, shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'd like to change the default shell prompt. lynnevan Linux - General 9 09-08-2011 08:00 AM
How to change the default shell to bash? shadkong Slackware 12 04-23-2005 03:49 PM
FreeBsd: login shell troubles KneeLess *BSD 2 06-03-2004 07:59 PM
changing my default shell after login? Quartzophobia Linux - General 1 02-11-2004 11:36 AM
How to change default root shell fessin Linux - General 2 02-13-2003 11:25 PM


All times are GMT -5. The time now is 11:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration