即使我可以使用凭据SSH,Fabric也要求密码 [英] Fabric asks for password even though I can SSH using credential
问题描述
使用Fabric部署Django站点时,我遇到了一个奇怪的问题。我已经配置了两台服务器来使用密钥文件进行登录。我可以在没有密码的情况下进入SSH。我可以正确地运行晶圆厂,
I'm having an odd problem while deploying a Django site using Fabric. I've configured two servers to use key files for login. I can SSH into both without a password. I can run fab on one correctly,
$ fab live pull
[mysite.com] Executing task 'pull'
[mysite.com] run: test -d proj
[mysite.com] run: test -d proj/.git
[mysite.com] run: git pull origin master
...
而其他服务器要求输入密码:
while the other server asks for a password:
$ fab staging pull
[dev.mysite.com] Executing task 'pull'
[dev.mysite.com] run: test -d proj
[dev.mysite.com] Login password:
fabfile是设置非常明确
The fabfile is set up pretty explicitly
def staging():
env.hosts = ['dev.mysite.com']
env.user = 'bamboo'
env.key_filename = '~/.ssh/id_dsa_bamboo'
直接从命令行运行ssh
And running ssh directly from the command line works
$ ssh bamboo@dev.mysite.com -i ~/.ssh/id_dsa_bamboo
Last login: Wed Apr 11 06:24:28 2012 from xxx.xxx.xx.xx
[bamboo@dev ~]$
我还尝试设置 env.use_ssh_config = True
并运行〜/ .ssh / config
设置为
I also tried setting env.use_ssh_config = True
and running with ~/.ssh/config
set to
Host dev.mysite.com
User bamboo
IdentityFile ~/.ssh/id_dsa_bamboo
ForwardAgent yes
有什么想法可能会发生什么?谢谢您的帮助。
Any ideas what could be going on? Thanks for the help.
推荐答案
您可以添加:
ssh.util.log_to_file("paramiko.log", 10)
您的fabfile,在导入之后,以获取有关授权过程的更多详细信息。
To the top of your fabfile, after the imports, to get more detailed information about the authorization process.
这篇关于即使我可以使用凭据SSH,Fabric也要求密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!