I have some ssh ldap users who connect to my server (centos7) for reset their password. I would like they use rbash for execute passwd command but I don't know how to do. I can't add rbash to /etc/passwd because they are LDAP user and they are not in this file.

I thought of 2 solutions, but not very safe:

  • Launch rbash (or passwd command) in sshd_config with 'ForceCommand'
  • Launch rbash in /etc/profile
  • thanks @Archemar. I added in /etc/sssd/sssd.conf : [nss] allowed_shell = /bin/rbash default_shell = /bin/rbash override_shell = /bin/rbash vetoed_shells = /bin/rbash shell_fallback = /bin/rbash
    – xavierjf
    Aug 1, 2016 at 10:05

1 Answer 1


went I set Active directory, I had to use samba.

In samba.conf there is a parameter called template shell, have you tried setting it ?

realm = MYREALM
template shell = /sbin/rbash

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .