#amazon(xxxxx)
フォーマット †
/etc/passwd †
name:password:uid:gid:gecos:home_dir:shell
フィールド | 内容 |
name | ログイン名 |
password | パスワード(passwdではxになる) |
uid | UID |
gid | GID |
gecos | 一般的な情報 |
home_dir | ホームディレクトリ |
shell | ログインシェル |
/etc/shadow †
name:password:change:re-change:disable:warn:inactive:expire:reserve
フィールド | 内容 |
name | ログイン名 |
password | パスワード(ハッシュされる、NPは未設定、*LK*はロック) |
change | 前回のパスワード変更日付(Epochからの経過日数) |
re-change | パスワードが変更可能になるまでの日数(changeからの経過日数) |
disable | パスワードの有効期限、これを超えると変更を要求される(changeからの経過日数) |
warn | パスワード有効期限が来る前に、ユーザが警告を受ける日数(disableからの遡り日数) |
inactive | パスワード有効期限が切れた後に、アカウントを停止するまでの日数(disableからの経過日数) |
expire | アカウントの有効期限(Epochからの経過日数) |
reserve | 予約フィールド |
- re-changeを3日、warnを5日、disableを30日に設定した場合。
日数 | フィールド | メッセージ |
0 | change | passwd: Sorry: less than 3 days since the last change. |
1 | | passwd: Sorry: less than 3 days since the last change. |
2 | | passwd: Sorry: less than 3 days since the last change. |
3 | re-change | |
| | |
25 | | |
26 | warn | Your password will expire in 5 days. |
27 | | Your password will expire in 4 days. |
28 | | Your password will expire in 3 days. |
29 | | Your password will expire in 2 days. |
30 | | Your password will expire in 1 day. |
31 | disable | Choose a new password. |
| | |
* | expire | Login incorrect |
/etc/group †
コマンド †
useradd †
# useradd [option] username
オプション | 意味 | 説明 |
-u uid | user id | UID |
-g gid | group id | GID |
-d dir | directory | ホーム ディレクトリ |
-m | make | ホームディレクトリが存在しない場合に新たに作成する |
-c comment | comment | 一般的な情報 |
-s shell | shell | ログインシェル |
-A auth | authorization | |
-P profile | profile | |
-e date | expire | アカウントの有効期限 |
-f date | inactive | 未試用期間が続いた場合に、アカウントを停止する日数 |
userdel †
usermod †
# usermod [option] username
オプション | 意味 | 説明 |
-u uid | user id | UID |
-g gid | group id | GID |
-d dir | directory | ホームディレクトリ |
-m | make | ホームディレクトリが存在しない場合に新たに作成する |
-c comment | comment | 一般的な情報 |
-l name | . | ユーザー名を変更する |
-s shell | shell | ログインシェル |
-e expire | expire | アカウントの有効期限 |
-f inactive | inactive | 未試用期間が続いた場合に、アカウントを停止する日数 |
-A auth | authorization | |
-P profile | profile | |
passwd †
# passwd [option] '''username'''
オプション | 意味 | 説明 |
-f | force | |
-n day | | パスワードが変更可能になるまでの日数 |
-x day | | パスワードの有効期限、これを超えると変更を要求される?(前回の変更からの経過日数) |
-w day | warn | パスワード有効期限が来る前に、ユーザが警告を受ける日数 |
デフォルト †
/etc/passwd †
root:x:0:1:Super-User:/:/bin/csh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
/etc/shadow †
root:<hash>:13094::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
smmsp:NP:6445::::::
listen:*LK*:::::::
nobody:NP:6445::::::
noaccess:NP:6445::::::
nobody4:NP:6445::::::
/etc/group †
root::0:root
other::1:
bin::2:root,bin,daemon
sys::3:root,bin,sys,adm
adm::4:root,adm,daemon
uucp::5:root,uucp
mail::6:root
tty::7:root,adm
lp::8:root,lp,adm
nuucp::9:root,nuucp
staff::10:
daemon::12:root,daemon
sysadmin::14:
smmsp::25:smmsp
nobody::60001:
noaccess::60002:
nogroup::65534: