zoukankan      html  css  js  c++  java
  • RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found

    RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found

    在多台Linux服务器SSH相互访问无需密码,

    其中进入一台Linus中,对其进行拷贝一下到host中,出现

    会不会是用户的权限问题,在root下执行:

    [root@host6 hadoop]# ssh-copy-id
    /usr/bin/ssh-copy-id: ERROR: No identities found

    为啥出现这个样子? (目前我也没有解决,若您知道其原因望告知一下!)

    查了半天,我得到一下几个方案:

    1.执行下面,去掉最小化安装的问题.

       yum -y install openssh-clients

    结果:

    [root@host6 .ssh]# yum -y install openssh-clients
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    Updating certificate-based repositories.
    Setting up Install Process
    Nothing to do

    [root@host6 .ssh]# exit
    exit
    [hadoop@host6 .ssh]$ sh-copy-id
    bash: sh-copy-id: command not found

    还是不行.

    2 找到了另外一个方法,即:

    1、如果ssh-copy-id 函数在远程服务器不存在;如下

    [root@kt02 .ssh]# ssh-copy-id -i  id_rsa.pub hadoop@host

    -bash: ssh-copy-id: command not found

         可以尝试用一下命令解决,直接复制本地的pubkey内容到远程服务器;

    即到host2或者host6中执行以下

    cat ~/.ssh/id_*.pub | ssh  hadoop@host2 'cat >> .ssh/authorized_keys'

    既可以了。

    转载于:多台Linux服务器SSH相互访问无需密码:http://kling.blog.51cto.com/3320545/1132800

  • 相关阅读:
    Python 常用内置函数
    Java Graphics 2D绘制图片 在Liunx上乱码
    LInux Centos7 重装yum
    Spring Boot 异步调用
    Linux 清除N天前的 日期文件夹(yyyy-MM-dd)
    Python 2.75升级3.6.3
    Linux 移除python Error: Trying to remove “yum”, which is protected
    Java Future 使用场景
    CF446D DZY Loves Games
    三 lambda表达式有什么用
  • 原文地址:https://www.cnblogs.com/nucdy/p/5664257.html
Copyright © 2011-2022 走看看