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.

SSH 鍵作成

Posted at

SSHの鍵生成方法

MAIL=
ssh-keygen -b 4096 -t rsa -f ~/.ssh/id_rsa.${MAIL}-$(date '+%Y%m') -C "${MAIL}-$(date '+%Y%m')"

PEM形式で作成する

MAIL=
ssh-keygen -b 4096 -m PEM -t rsa -f ~/.ssh/id_rsa.${MAIL}-$(date '+%Y%m') -C "${MAIL}-$(date '+%Y%m')"

秘密鍵から公開鍵を作成

OpenSSH形式

ssh-keygen -yf ${private_key_file} > ${public_key_file}

PEM形式

openssl rsa -in ${PRIVATE_KEY_PEM}  -pubout -out ${PUBLIC_KEY_PEM}

利用

ssh -i ~/.ssh/id_rsa.${MAIL}-${DATE}
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?