首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Fabric连接到aws-ec2时禁用密码提示。

使用Fabric连接到aws-ec2时禁用密码提示。
EN

Stack Overflow用户
提问于 2017-05-17 20:47:22
回答 1查看 202关注 0票数 1

当与Fabric连接时,我会被提示输入密码,当手动连接时,我什么也得不到--只是连接。

你知道会有什么问题吗?

我使用的是基于ubuntu 16的aws ec2实例。在我的计算机上,我正在运行运行以下代码的"fab测试“:

代码语言:javascript
复制
from fabric.api import *
import paramiko
paramiko.util.log_to_file("fab.log")
env.key_filename = '~/.ssh/etay-new.pem'
env.hosts = ['my.real-ip.trust.me']
env.user = 'ubuntu'

def test():
    run('ls');

我检查了sshd_config,ChallengeResponseAuthentication和PasswordAuthentication设置为NO。

fab.log:

代码语言:javascript
复制
DEB [20170518-00:12:30.497] thr=1   paramiko.transport: starting thread (client mode): 0x558bbe50L
INF [20170518-00:12:30.742] thr=1   paramiko.transport: Connected (version 2.0, client OpenSSH_7.2p2)
DEB [20170518-00:12:30.969] thr=1   paramiko.transport: kex algos:['curve25519-sha256@libssh.org', 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group14-sha1'] server key:['ssh-rsa', 'rsa-sha2-512', 'rsa-sha2-256', 'ecdsa-sha2-nistp256', 'ssh-ed25519'] client encrypt:['chacha20-poly1305@openssh.com', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'aes128-gcm@openssh.com', 'aes256-gcm@openssh.com'] server encrypt:['chacha20-poly1305@openssh.com', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'aes128-gcm@openssh.com', 'aes256-gcm@openssh.com'] client mac:['umac-64-etm@openssh.com', 'umac-128-etm@openssh.com', 'hmac-sha2-256-etm@openssh.com', 'hmac-sha2-512-etm@openssh.com', 'hmac-sha1-etm@openssh.com', 'umac-64@openssh.com', 'umac-128@openssh.com', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1'] server mac:['umac-64-etm@openssh.com', 'umac-128-etm@openssh.com', 'hmac-sha2-256-etm@openssh.com', 'hmac-sha2-512-etm@openssh.com', 'hmac-sha1-etm@openssh.com', 'umac-64@openssh.com', 'umac-128@openssh.com', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1'] client compress:['none', 'zlib@openssh.com'] server compress:['none', 'zlib@openssh.com'] client lang:[''] server lang:[''] kex follows?False
ERR [20170518-00:12:30.969] thr=1   paramiko.transport: Exception: Incompatible ssh peer (no acceptable kex algorithm)
ERR [20170518-00:12:30.969] thr=1   paramiko.transport: Traceback (most recent call last):
ERR [20170518-00:12:30.969] thr=1   paramiko.transport:   File "/usr/lib/python2.7/dist-packages/paramiko/transport.py", line 1585, in run
ERR [20170518-00:12:30.969] thr=1   paramiko.transport:     self._handler_table[ptype](self, m)
ERR [20170518-00:12:30.970] thr=1   paramiko.transport:   File "/usr/lib/python2.7/dist-packages/paramiko/transport.py", line 1664, in _negotiate_keys
ERR [20170518-00:12:30.970] thr=1   paramiko.transport:     self._parse_kex_init(m)
ERR [20170518-00:12:30.970] thr=1   paramiko.transport:   File "/usr/lib/python2.7/dist-packages/paramiko/transport.py", line 1779, in _parse_kex_init
ERR [20170518-00:12:30.970] thr=1   paramiko.transport:     raise SSHException('Incompatible ssh peer (no acceptable kex algorithm)')
ERR [20170518-00:12:30.970] thr=1   paramiko.transport: SSHException: Incompatible ssh peer (no acceptable kex algorithm)
ERR [20170518-00:12:30.970] thr=1   paramiko.transport: 

知道该怎么做吗?我不想被提示输入密码。

谢谢你,埃泰

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-17 21:47:18

请将paramiko版本更新为最新的2.1版本。

Ubuntu 16有一个更新的sshd版本,paramiko 1.1不支持它。

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

https://stackoverflow.com/questions/44034515

复制
相关文章

相似问题

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