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

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

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

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

[[email protected] hadoop]# ssh-copy-id
/usr/bin/ssh-copy-id: ERROR: No identities found

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

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

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

   yum -y install openssh-clients

结果:

[[email protected] .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

[[email protected] .ssh]# exit
exit
[[email protected] .ssh]$ sh-copy-id
bash: sh-copy-id: command not found

还是不行.

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

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

[[email protected] .ssh]# ssh-copy-id -i  id_rsa.pub [email protected]
-bash: ssh-copy-id: command not found

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

即到host2或者host6中执行以下

cat ~/.ssh/id_*.pub | ssh  [email protected] ‘cat >> .ssh/authorized_keys‘

既可以了。

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

时间: 2024-08-25 21:36:32

RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found的相关文章

npm i命令报错“Please try running this command again as root/Administrator”

相对npm install命令不够正规,虽然使用npm -help命令查看npm i和npm install的内容是一样的,但是我使用的intellij 2017.2.4版本会经常对"npm i"这个命令报这个错.所以建议使用npm install命令.然而,还会出现这个错误的话就可以忽视了,毕竟我用angular-cli工具创建的项目初始安装包npm install即便报错也不必理会,继续npm start测试编译通过,浏览器可以正常打开页面.

关于 在cygwin64 Terminal 输入 $ ssh ,却报错 -bash: ssh: command not found 的解决方案 !

1 1 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxx

Linux中,使用SSH过程中,sh-copy-id命令报错:-bash: ssh-copy-id: command not found

Linux中,使用SSH过程中,sh-copy-id命令报错:-bash: ssh-copy-id: command not found在服务器之间传送文件我们经常会使用SCP命令来进行传送文件,但是每次都要进行密码验证,非常繁琐,所以通常我们会用ssh免密码登录. 首先,我们会在目的端生成私钥和公钥 (使用:–ssh-keygen -t rsa 命令),然后通过ssh-copy-id -i ~/.ssh/id_rsa.put 的方式,将目的端的公钥导入发送端,来进行实现免密连接. 但是总会遇到

191016 Linux中python2升级到python3导致yum命令报错

因为python2到python3的升级,导致使用yum相关的命令时报错: 报错一: command not found... 方案:修改/usr/bin/yum文件的第一行,将结尾的python改成python27(或python2.7),请自行尝试,修改后能查询yum版本即可: 报错二:cannot retrieve matalink for repository:epel/x86... 方案:sed -i ‘s#https://#http://#g' /etc/yum.repos.d/ep

windows下使用GNU make命令报错的解决方法

windows下使用GNU make命令报错的解决方法=> 错误信息:make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3) ## 1.原因环境变量中配置了`D:\Program Files (x86)\Git\bin`,该目录下存在一个`sh.exe` 在执行make命令时,如果在`MakeFile`文件中没有指定shell的路径,`make`就会到环境变量中,去找一个`X:\\XXX\XXX\sh.exe`作

记hbase list 命令报错zookeeper连接失败

hbase list 命令报错:zookeeper exists failed after 4 attempts $telnet h0082161 2181 Connected to 172.16.82.161.Escape character is '^]'. telnet connect by close foreign. 此时发现telnet h0082161 其他端口均正常,其他机器telnet h0082161 2181正常, 此时进入一个误区,一直在围绕telnet 服务查看,查看/

CURL命令报错:dyld: lazy symbol binding failed: Symbol not found: _SSL_load_error_strings解决办法

Mac OS X 10.11.6, curl 命令报错,错误如下: dyld: lazy symbol binding failed: Symbol not found: _SSL_load_error_strings Referenced from: /usr/local/lib/libcurl.4.dylib Expected in: flat namespace dyld: Symbol not found: _SSL_load_error_strings Referenced from:

Ubuntu下sh *.sh使用==操作符执行报错

----<鸟哥的Linux私房菜--基础篇>学习笔记 ubuntu默认的sh是连接到dash,而我们写shell脚本时使用的时bash.bash和dash在一些方面是不兼容的.因此执行同一个脚本,两者结果不一样,可能用./*sh可以执行,而sh *.sh报错. 为了正确实行使用./*.h 或者  bash *.sh  或者把==换成=(不兼容部分) 也可以直接让系统不使用dash....Ubuntu之所以使用dash是因为其体积小,兼容性高,但是悲催的时,一些bash可执行的脚步在dash下不

执行 maven 命令 报错Unable to add module to the current project as it is not of packaging type &#39;pom&#39;[转]

今天学习在本地搭建Maven工程时,执行了mvn archetype:generate 命令,报错. Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:1.1] Unable to add module to the current project as it is not of packaging type 'pom' 上网搜资料发现一个帖子,问题解决:

解决docker images,info,-d等命令报错的问题

解决docker images,info,-d等命令报错的问题 楼主因为在搞docker,所以出现了好多的问题,百度上不好找,谷歌的话,楼主不会翻墙.不管给大家推荐一个软件:蓝灯. 楼主不管输入那个命令,都出现了: FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host? 以及类似的错误,就连docker version命令都报错了,楼主开始找啊找,找到了好多东西,结果发现没一个能行的