LoginSignup
0
0

More than 1 year has passed since last update.

Linux ローカルユーザーパスワード覚え書き

Last updated at Posted at 2022-05-16
/etc/shadow

第2フィールドに格納
例:

aho:$y$j9T$o8MJgcu/zxjLLjo3pBk4A.$SPwoNr7I95/JHVKBeTnsu1mSC//M76vfmKc6mE6lSe2:19128:0:99999:7:::
$id$cpu_time_cost$salt$hash

$y$j9T$o8MJgcu/zxjLLjo3pBk4A.$SPwoNr7I95/JHVKBeTnsu1mSC//M76vfmKc6mE6lSe2

id
y - Yescrypt
1 - MD5
2a,2b,2x,2y - Blowfish (bcrypt)
5 - SHA256
6 - SHA512
Ubuntu 22.04 LTS での確認によると、デフォでYescrypt を使用 (もうSHA256/SHA512などでなく)。
参考 : FedoraにおけるYescryptの能書き
https://fedoraproject.org/wiki/Changes/yescrypt_as_default_hashing_method_for_shadow

PAM(Pluggable Authentication Modules)
-> 認証をシステムワイドで(OS+各アプリケーションにまたがって)つかさどる

PAMの設定ファイル:
Ubuntu は /etc/pam.d/common-password
CentOS は /etc/pam.d/system-auth

/etc/pam.d/common-password

# Explanation of pam_unix options:
# The "yescrypt" option enables
#hashed passwords using the yescrypt algorithm, introduced in Debian
#11.  Without this option, the default is Unix crypt.  Prior releases
#used the option "sha512"; if a shadow password hash will be shared
#between Debian 11 and older releases replace "yescrypt" with "sha512"
#for compatibility .  The "obscure" option replaces the old
#`OBSCURE_CHECKS_ENAB' option in login.defs.  See the pam_unix manpage
#for other options.
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