Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
リモートサーバー上のrootアカウントのauthorized_keysファイルに公開鍵を追加するために実行できる最も簡単なコマンドのセットを探しています。
現在のユーザーがリモートサーバーへのログインアクセス権を持っており、sudoersファイルにもリストされていることを前提としています。
コマンドを2回実行しても、効果はありません。
ssh-copy-idコマンドを実行するのはどうですか?マニュアルページには次のように書かれています。
ssh-copy-id-リモートマシンのauthorized_keysに公開鍵をインストールします
まさにあなたが探しているものに聞こえますか?ただし、コマンドを2回実行しようとしたことはありません。それをチェックしないかもしれません。