inohilog

/var/log/inohiro.log

ssh-keygen と htpasswd コマンド

久しぶりに使って、いろいろ調べたので覚え書きしておく。

ssh-keygen コマンド

SSHに用いる鍵のペアを生成。

ssh-keygen [-b bits] [-f file] [-N new_passphrase] [-C comment]
オプション
  • -b bits かぎの長さを指定する。最低値は512ビットで,初期設定値は1024ビット
  • -c かぎ内のコメントを変更する
  • -f かぎのファイル名を指定する
  • -p パス・フレーズを変更する
  • -C コメントを指定する
  • -N 新しいパス・フレーズを指定する
  • -P 古いパス・フレーズを指定する
備考

引数なしで実行すると対話的に鍵の生成を行うことができる。しかしbit長はあらかじめ指定しておかないといけない。

htpasswd コマンド

inohiro-mac:hinatan inohiro$ htpasswd
Usage:
	htpasswd [-cmdpsD] passwordfile username
	htpasswd -b[cmdpsD] passwordfile username password

	htpasswd -n[mdps] username
	htpasswd -nb[mdps] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.