Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh 让gitolite自动使用LDAP发布密钥_Ssh_Ldap_Gitolite - Fatal编程技术网

Ssh 让gitolite自动使用LDAP发布密钥

Ssh 让gitolite自动使用LDAP发布密钥,ssh,ldap,gitolite,Ssh,Ldap,Gitolite,我们用户的所有公钥都在LDAP中。Gitolite已经从这个LDAP中获取用户名和组。但是对于每个新用户,我们必须手动将userkey添加到gitolite的keydir中 有没有办法让gitolite直接从LDAP自动获取密钥?gitolite从authorizedkyes文件获取用户。将新公钥添加到“密钥”文件夹时会生成此文件 您必须将ssh配置为对授权密钥文件使用外部命令。从OpenSSH6.1可以使用AuthorizedKeysCommand(用于外部命令)和AuthorizedKeys

我们用户的所有公钥都在LDAP中。Gitolite已经从这个LDAP中获取用户名和组。但是对于每个新用户,我们必须手动将userkey添加到gitolite的keydir中


有没有办法让gitolite直接从LDAP自动获取密钥?

gitolite从authorizedkyes文件获取用户。将新公钥添加到“密钥”文件夹时会生成此文件

您必须将ssh配置为对授权密钥文件使用外部命令。从OpenSSH6.1可以使用AuthorizedKeysCommand(用于外部命令)和AuthorizedKeysCommand(在命令将运行的id下)。您必须编写自己的脚本或从internet上调整脚本以提供正确的输出。该命令接受一个选项(uid)并将公钥列表返回给用户

如果您检查gitolite的授权密钥,它看起来更高级

command="/usr/share/gitolite/gl-auth-command username",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3Nza

因此,如果用户与gitolite用户(通常为git或gitolite)匹配,您必须调整脚本以生成这样的输出。

您使用什么模式来保存密钥?它们保存在用户的sshRSAAuthKey属性字段中。我知道如何查询它们,但我不知道如何让gitolite查询它们。