LoginSignup
13
13

More than 5 years have passed since last update.

RHEL/CentOSにおけるUIDとGIDの取れる範囲は?

Last updated at Posted at 2014-07-20

UIDとGIDの取れる範囲を知りたい

モチベーション

  • UIDとGIDの割り当てをシステムに任せたくない
    • グループだけ作ると以降のUIDとGIDが1つずれることになる
  • UIDとGIDを指定したいが、取れる範囲がわからない

login.defsを確認

  • 取れる範囲は"500~60000"であることがわかった
    • 実際には"70000"を指定して作成できるが、"500~60000"の範囲に収めるのが無難かな
  • 詳細はman login.defsで確認するかLOGIN.DEFS(5)を参照する
# egrep -i 'gid|uid' /etc/login.defs
/etc/login.defs
# Min/max values for automatic uid selection in useradd
UID_MIN                   500
UID_MAX                 60000
# Min/max values for automatic gid selection in groupadd
GID_MIN                   500
GID_MAX                 60000
13
13
1

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
13
13