0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

まえがき

個人の学習用に使っているリポジトリのssh鍵を新しい端末へ引き継いだので、作業内容をメモ書きとして残します。

手順1. ssh秘密鍵&公開鍵を移行先PCヘコピペ

移行元の ~/.ssh にある id_rsaid_rsa.pub をコピーし、移行先の ~/.ssh にペーストします。

私はUSBメモリを利用してコピペしましたが、セキュリティ観点からインターネット経由でのコピペは控えた方が無難かと思います。

手順2. パーミッション変更

秘密鍵にはプロテクトがかかっている必要があるので、パーミッションを変更します。
chmod コマンドを使って id_rsa「所有者のみ読み書き可能」(600)な状態にしましょう。

# 変更前のパーミッションを確認
% ls -l ~/.ssh/id_rsa
-rw-r--r--@ 1 UserName  staff  3430  7 16 23:44 id_rsa

# 所有者のみ読み書き可能なパーミッションへ変更
% chmod 600 ~/.ssh/id_rsa

# パーミッションの変更を確認
% ls -l ~/.ssh/id_rsa
-rw-------@ 1 UserName  staff  3430  7 16 23:45 id_rsa
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?