我目前使用ActiveDirectory在我的Ubuntu 10.04服务器上使用名为Centrify Express的工具进行身份validation。 Centrify具有在/etc/pam.d/common-auth中configuration的自定义.so文件。
我想为SFTP用户(不是SSHlogin)进行正常的LDAPauthentication(绕过centrify)。 我如何configuration/etc/pam.d/sshd尝试对SFTPlogin进行LDAP身份validation,而不是SSHlogin? 这个想法是,我的SFTP OU将允许用户下载和上传文件,但他们将无法获得一个壳。
如果我正确理解你的问题,你正在寻找只提供sftp服务(也就是说,没有通过ssh交互式login)。
您可以强制连接使用sftp服务,方法是将其添加到sshd_config文件中:
ForceCommand internal-sftp
这在sshd_config手册页中有logging:
ForceCommand Forces the execution of the command specified by ForceCommand, ignoring any command supplied by the client and ~/.ssh/rc if present. The command is invoked by using the user's login shell with the -c option. This applies to shell, command, or subsys- tem execution. It is most useful inside a Match block. The command originally supplied by the client is available in the SSH_ORIGINAL_COMMAND environment variable. Specifying a command of “internal-sftp” will force the use of an in-process sftp server that requires no support files when used with ChrootDirectory.
您可以修改/etc/pam.d/sshd来configurationsshd使用正常的pam_ldap模块,而不是Centrify提供的pam模块。
通过这些configuration更改, sftp连接将使用正常的LDAP身份validation,并且交互式shell将不可用。
我不认为你可以限制它在帕姆,但如果你让所有的用户,你想收缩一个组的成员,你可以有SSH限制什么这些用户可以通过匹配组等。