目前,我使用一个名为Centrify Express的工具在Ubuntu10.04服务器上使用ActiveDirectory进行身份验证。Centrify有一个自定义的.so文件,配置在/etc/pam.d/common中。
我希望只对SFTP用户(而不是SSH登录)进行正常的LDAP身份验证(绕过centrify)。我将如何配置/etc/pan.d/sshd来尝试SFTP登录的LDAP身份验证,而不是SSH登录呢?我的想法是,我的SFTP OU允许用户下载和上传文件,但是他们无法获得shell。
发布于 2012-05-24 18:35:39
如果我正确理解你的问题,你只想提供sftp服务(也就是说,不通过ssh进行交互登录)。
通过将此添加到sftp文件中,可以强制连接使用sshd_config服务:
ForceCommand internal-sftp这在sshd_config手册页中有记录:
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以配置sshd以使用常规的pam_ldap模块,而不是Centrify提供的pam模块。
在这些配置更改到位后,sftp连接将使用正常的LDAP身份验证,而交互式shell将不可用。
发布于 2012-05-24 18:08:53
我不认为您可以在pam中限制它,但是如果您让想要限制一个组成员的所有用户,可以让ssh通过match组blah限制这些用户可以做什么。
https://serverfault.com/questions/392308
复制相似问题