LoginSignup
1
2

More than 5 years have passed since last update.

sshを公開鍵で認証するためにやること

Last updated at Posted at 2016-05-27

忘れてしまうので自分用のメモ

以下のコマンドを、クライアント側(sshの接続元)で実行します。

$ mkdir ~/.ssh && pushd ~/.ssh
$ ssh-keygen -t rsa
# パスフレーズ等必要なければ Enter 連打
$ ssh ユーザ名@IPアドレス "cat > ~/.ssh/authorized_keys; chmod 600 /root/.ssh/authorized_keys" < id_rsa.pub
# サーバ側に authorized_keys が存在する場合は「>」を「>>」にすること
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2