
コンテンツをリモートホストにssh-copy-id
コピーするために使用しようとしています。id_rsa.pub
~/.ssh/authorized_keys
次のコマンドを実行します。
$ ssh-copy-id remoteuser@remotehost
しかし、次のエラーがあります。
/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
remoteuser@remotehost's password:
rootsh: bad characters in arguments
答え1
このサーバーは次の名前のサーバーを使用しているようです。ロシュ。このチュートリアルのタイトルは次のとおりです。Linuxシェルのユーザーアクティビティを追跡する方法は?それも覆いました。
rootsh:パラメータに無効な文字が含まれています。
ssh
この種のシナリオでは、サーバーにアクセスし、$HOME/.ssh/authorized_keys
SSHキーペアの公開部分を手動でユーザーアカウントファイルにコピーして貼り付ける必要があります。
メモ:SSHキーは通常ローカルシステム()にあります~/.ssh/id_rsa.pub
。だからエディタで開いてクリップボードにコピーした後、リモートssh
サーバーにコピーしてauthorized_keys
ファイル(上)を開いてクリップボードを貼り付けて保存すればよい。
答え2
次のコマンドを試してください。
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys