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?

秘密鍵から公開鍵を導出する

Last updated at Posted at 2025-01-20

sh

ssh鍵を更新したあかつきにauthorized_keysファイルから旧公開鍵を削除したいんだが、ラベルがなくてどれやと途方に暮れたときに秘密鍵をソースにssh-keygen -yで公開鍵を導出できる

sh
# 秘密鍵の公開鍵をプリント
ssh-keygen \
-y \ # 公開鍵の抽出オプション
-f path/to/private_key # 秘密鍵の指定オプション

> ssh-rsa XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

# 上記の公開鍵を削除する
vi path/to/authorized_keys
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?