推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wzaqqq
V2EX  ›  Python

paramiko 认证问题 paramiko.transport Authentication (publickey) failed.

  •  
  •   wzaqqq · May 2, 2018 · 5429 views
    This topic created in 2958 days ago, the information mentioned may be changed or developed.

    ansible 连接远程主机时报错: 192.168.195.10 | UNREACHABLE! => { "changed": false, "msg": "Authentication failed.", "unreachable": true }

    日志显示:paramiko.transport Authentication (publickey) failed. 但是我直接 ssh 无密码登录是可以的,比了下 /root/.ssh/id_rsa.pub 和远程的 /root/.ssh/authorized_keys 也是匹配的。 各位大佬有遇到的么?

    4 replies    2018-05-02 20:58:55 +08:00
    julyclyde
        1
    julyclyde  
       May 2, 2018
    paramiko 的版本号多少?
    wzaqqq
        2
    wzaqqq  
    OP
       May 2, 2018
    2.4.1
    wzaqqq
        3
    wzaqqq  
    OP
       May 2, 2018
    @julyclyde 看错了,是 yum 装的,版本 1.7.5 (Ernest)
    wzaqqq
        4
    wzaqqq  
    OP
       May 2, 2018
    @julyclyde 找到原因了,用非 root 用户登录的然后 su 到 root 安装的 ansible,导致 publickey 出问题,改成从 root 直连,重装就好了。十分感谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3592 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 04:48 · PVG 12:48 · LAX 21:48 · JFK 00:48
    ♥ Do have faith in what you're doing.