Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a LDAP server and a predefined shell (bash) set in it. But there are some machine on which I want a different shell to be used whenever user login to that instead of the shell stored in LDAP.

How can I do this?? Can someone give me some direction in this?

Thank you

share|improve this question
    
which os/version? –  rkthkr Apr 20 '10 at 6:22
    
OS - Debian Lenny –  Incredible Apr 21 '10 at 9:34

2 Answers 2

In /etc/ldap.conf add the following line:

nss_override_attribute_value loginShell <different_shell>
share|improve this answer
    
Just a note that for this to work for me, I had to restart nscd after the change (/etc/init.d/nscd restart) –  Michael Mior Dec 21 '13 at 2:47

Shared home directories? If not, put into the users ~/.bash_profile (or whatever is the proper file, check INVOCATION in man bash):

exec /bin/tcsh

Or whatever shell you wish to replace bash with.

If they login using ssh, then you could use keypairs and forced commands.

share|improve this answer
    
Users will be login through ssh. Can you please elaborate a bit more on the use of keypairs and forced commands option. Can you please give me some pointers? Thank you. –  Incredible Apr 21 '10 at 9:36
    
SSH keypairs: <sial.org/howto/openssh/publickey-auth/>; Information about forced commands can be found on the man pages sshd(8) and sshd_config(5) –  ptman Apr 21 '10 at 12:32
    
I couldn't find an option that automatically does it for all users. It should be something related to ldap as well, because here sshd will read the default shell from ldap. And I want to override that. –  Incredible Apr 24 '10 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.