0
0

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.

Macで公開鍵と秘密鍵を生成する

Last updated at Posted at 2023-01-21

環境情報

バージョン
OS macOS12.1

コマンド

.sshディレクトリを作成し、移動する

$ cd ~/
$ mkdir .ssh
$ cd .ssh

鍵を生成する

$ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/{ユーザ名}/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): {任意のパスワード}
Enter same passphrase again: {任意のパスワード}
Your identification has been saved in /Users/{ユーザ名}/.ssh/id_rsa
Your public key has been saved in /Users/{ユーザ名}/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:v4UT6QGnjdhJ/TCDeKYxaojhv/0oNTU0yq+CLzePZb0 {ローカル環境のPC名}
The key's randomart image is:
+---[RSA 3072]----+
|                 |
|       + o       |
|.   . * B *      |
|.o . + % B *     |
|... o = S = .    |
|  .. o.. o +     |
|  ...oo.  = .    |
| o =*.. .  +     |
|  ++=+.E  .      |
+----[SHA256]-----+

鍵を確認する

$ ls -al
-rw-------   1 {ユーザ名} {グループ名}  2675  1 21 16:06 id_rsa
-rw-r--r--   1 {ユーザ名} {グループ名}   592  1 21 16:06 id_rsa.pub
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?