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?

CSR を発行するための Linux コマンド 忘備録

Posted at

moemo

  • /etc/ssl/private/ # 秘密鍵の保存用ディレクトリ
  • /etc/ssl/certs/ # 証明書の保存用ディレクトリ

作業ディレクトリ

  • /etc/ssl/private

CSRの発行

ディレクトリの作成(存在しない場合)

bash
sudo mkdir -p /etc/ssl/private
sudo mkdir -p /etc/ssl/certs

適切な権限を設定

bash
sudo chmod 700 /etc/ssl/private
sudo chmod 755 /etc/ssl/certs

作業ディレクトリに移動

bash
cd /etc/ssl/private

秘密鍵の生成

sudo openssl genrsa -out /etc/ssl/private/foobar.jp.key 2048

CSRの生成

sudo openssl req -new \
-key /etc/ssl/private/foobar.jp.key \
-out /etc/ssl/certs/foobar.jp.csr \
-subj "/C=JP/ST=Kyoto/L=Kyoto-shi/O=City of Kyoto/CN=foobar.jp"

作業後は適切な権限を設定

sudo chmod 600 /etc/ssl/private/foobar.jp.key
sudo chmod 644 /etc/ssl/certs/foobar.jp.csr
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?