Help us understand the problem. What is going on with this article?

秘密鍵、公開鍵を他のPCに移す手順

More than 1 year has passed since last update.

概要

古いMacbookから新しいMacbookへの秘密鍵の移動、公開鍵を秘密鍵から生成

手順

まず古いMacbookを起動し、リモート接続できるようにします。
System Preferences -> Sharing
Screen Shot 2019-08-16 at 23.39.50.png

Screen Shot 2019-08-16 at 23.21.36.png
画像のようにRemote Loginにチェックを入れます。

次に新しいMacで画像にある古いPCへのSSH接続コマンドをTerminalに入力し、古いPCにログインします。

秘密鍵転送の一連の流れ

# 新しいPCでの作業
ls ~/.ssh # 秘密鍵があるか確認

exit # 新しいPCに戻る。

# ユーザー名とホスト名は古いPCで確認したsshコマンドに ユーザー名@古いPCのホスト名 と書いてある
# 新しいPCの~/.sshに転送
scp ユーザー名@古いPCのホスト名:古いPCの秘密鍵のパス ~/.ssh

秘密鍵から公開鍵を生成

なんと公開鍵は秘密鍵から生成できます。

ssh-keygen -y -f ~/.ssh/公開鍵名 > ~/.ssh/公開鍵名.pub
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした