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