LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   No default shell (https://www.linuxquestions.org/questions/linux-general-1/no-default-shell-463614/)

jovie 07-13-2006 06:58 AM

No default shell
 
Hi can anyone explain this?

Basically my users aren't getting the shell and therefore environment they want at login. I'm not sure what shell they get but it certainly isn't /bin/bash using their own .bashrc, even though /bin/bash is what they have set as default. (So maybe it's just not reading the .bashrcs?)

Code:

Last login: Thu Jul 13 12:01:44 2006 from ###.###.###.###
-bash-3.00$ echo $shell
 
-bash-3.00$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
-bash-3.00$ grep 'username' /etc/passwd
username:x:504:504::/users/username:/bin/bash
-bash-3.00$ ls -l /bin/bash
-rwxr-xr-x  1 root root 686520 May 10  2005 /bin/bash
-bash-3.00$ which bash
/bin/bash
-bash-3.00$ bash
[username@ ~]# echo $shell
 
[username@ ~]#echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
[username@ ~]# echo $shell
 
[username@ ~]#echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin/phred:.:/users/username/bin/Decoder:/usr/software/exec/phrap:/usr/software/exec/:/data/ncbi/::/usr/software/bin/
[username@ ~]#exit
exit
/bin/:/usr/software/GOtcha/bin/:/usr/software/bin/
[username@ ~]#exit
exit

Anyone know how I get users loging in to a bash shell with their own .bashrc settings?

(I have tried chsh but the default shell is already set to the shell I want to use)

Thanks
Ann :scratch:

druuna 07-13-2006 07:13 AM

Hi,

Should echo $shell not be echo $SHELL?

The $shell/$SHELL variable is not global. I.e. echo $SHELL works for bash shells, $shell works for tcsh.

Hope this helps.

ethics 07-13-2006 07:35 AM

can you not obtain what shell they are using (and also edit) from /etc/passwd?

jovie 07-13-2006 08:19 AM

[QUOTE=druuna]Hi,

Should echo $shell not be echo $SHELL?

/QUOTE]


Yes of course Thanks you.

Code:

-bash-3.00$ echo $SHELL
/bin/bash

So they're logging in to a bash shell but not getting the environment defined in their own .bashrc and as running bash starts a new shell with the .bashrc settings I don't think there's an error in .bashrc .

It's a problem for all users who all have default bash. root uses tcsh and reads ~/.tcsh fine.

There's no help in /var/log/secure or /var/log/messages. Anywhere else I could be looking?

Fedora core 4 BTW.

Thanks
Ann

druuna 07-13-2006 08:36 AM

Hi,

The config file(s) that are read when a bash shell is started depends on several things:

- is it a login shell,
- is it a interactive shell.

The ~/.bashrc file is only parsed if the bash shell is a interactive shell that is not a login shell.

~/.bash_profile, ~/.bash_logout and ~/.profile are parsed if the bash shell is an interactive login shell, or a non-inter-active shell with the --login option.

See the bash manpage (section: INVOCATION) for details.

Hope this clears things up a bit.


All times are GMT -5. The time now is 09:29 AM.