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 '16 at 10:05

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 ?

[global]
(...)
realm = MYREALM
template shell = /sbin/rbash

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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