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  则登录我的服务器成功

     

  • 相关阅读:
    日期格式
    v-model修饰符
    从0到1构建全栈知识体系
    Element组件,v-for循环,表单验证方法
    上传文件转换为base64图片
    gulp4进阶
    gulp4快速入门
    TS-接口
    webpack4.0高级
    webpack4.0基础
  • 原文地址:https://www.cnblogs.com/wwyxyt/p/7509444.html
Copyright © 2011-2022 走看看