zoukankan      html  css  js  c++  java
  • ansible 学习难点攻克

    昨天进行了ansible的学习。使用服务器已经由同事安装完成。

    在执行

    ssh-copy-id wang@XXX.xx.xxx时报错。

    Jenkins:~ jenkins$ ssh-copy-id root@xxxx
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/jenkins
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filt
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are pro
    Permission denied (publickey).

    错误原因:ssh在没有密钥登录的情况下,禁用了密码登录,故出现如上错误。

    解决办法:

    登录服务器,将/etc/ssh/sshd_config文件中的PasswordAuthentication no 改为PasswordAuthentication yes

    重启sshd服务:/etc/init.d/ssh restart

    再次执行:

    Jenkins:~ jenkins$ ssh-copy-id wang@xxxx
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/jenkins/.ssh/id_rsa.pub"
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    wang@119.23.241.8's password:

    输入密码即成功。

    输入ssh wang@xxxxx  则登录我的服务器成功

     

  • 相关阅读:
    bzoj4196: [Noi2015]软件包管理器
    bzoj3083: 遥远的国度
    bzoj4034: [HAOI2015]T2
    2.EXIT_KEY
    AD如何1比1打印
    编程时注意,
    同步事件、异步事件、轮询
    事件位
    挂起进程相关API
    PROCESS_EVENT_POLL事件
  • 原文地址:https://www.cnblogs.com/wwyxyt/p/7509444.html
Copyright © 2011-2022 走看看