首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何仅为SFTP登录启用LDAP auth

如何仅为SFTP登录启用LDAP auth
EN

Server Fault用户
提问于 2012-05-24 16:42:46
回答 2查看 9.3K关注 0票数 1

目前,我使用一个名为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。

EN

回答 2

Server Fault用户

发布于 2012-05-24 18:35:39

如果我正确理解你的问题,你只想提供sftp服务(也就是说,不通过ssh进行交互登录)。

通过将此添加到sftp文件中,可以强制连接使用sshd_config服务:

代码语言:javascript
复制
ForceCommand internal-sftp

这在sshd_config手册页中有记录:

代码语言:javascript
复制
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将不可用。

票数 2
EN

Server Fault用户

发布于 2012-05-24 18:08:53

我不认为您可以在pam中限制它,但是如果您让想要限制一个组成员的所有用户,可以让ssh通过match组blah限制这些用户可以做什么。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/392308

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档