2
0

More than 1 year has passed since last update.

OpenSSL コマンドでサーバー上で直接 .htpasswd に ID & パスワードを追加する

Last updated at Posted at 2021-11-26

サーバーに OpenSSL プログラムが大抵入っているので、コマンドで ID&パスワードを追加できます。

sudo sh -c "echo -n 'ユーザー名:$(openssl passwd -apr1 パスワード)' >> [パス]/.htpasswd"

or sudo 無しなら

echo -n 'ユーザー名:$(openssl passwd -apr1 パスワード)' >> [パス]/.htpasswd

sudo : 必要に応じて、sudo 無し、sudo -u ユーザー指定で実行する
-apr1 : パスワード形式。もっと強固なもに
>> : 既存のテキストファイルに、追記する

参考
https://qiita.com/STSynthe/items/5387bc33e7be315ae338

2
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
2
0