ユーザープロファイル管理
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
パスワードに有効期限を設定
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[root@localhost ~]# chage
Usage: chage [options] user
Options:
-d, –lastday LAST_DAY set last password change to LAST_DAY
-E, –expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, –help display this help message and exit
-I, –inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, –list show account aging information
-m, –mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, –maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-W, –warndays WARN_DAYS set expiration warning days to WARN_DAYS
[root@localhost ~]#
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
アカウントの確認
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[root@localhost ~]# chage -l admin
Last password change : 10月 04, 2007
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[root@localhost ~]#
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↑のアカウントはディフォルトのままなので,設定を変更する
パスワード変更には最低1日
パスワード有効期限90日
パスワードが切れる30日前から警告が出る
パスワードが切れると7日間待ってアカウントロック
アカウント無効化の日は2010年4月1日に設定
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[root@localhost ~]# chage -m 1 -M 90 -W 30 -I 7 -E 2010-04-01 admin
[root@localhost ~]# chage -l admin
Last password change : 10月 04, 2007
Password expires : 1月 02, 2008
Password inactive : 1月 09, 2008
Account expires : 4月 01, 2010
Minimum number of days between password change : 1
Maximum number of days between password change : 90
Number of days of warning before password expires : 30
[root@localhost ~]#
[root@localhost ~]# cat /etc/shadow | grep admin
admin:$1$FssAdbea$.hYb8/RSdjmqZ4yDuFcAd1:13790:1:90:30:7:14700:
administrator:!!:13835:0:99999:7:::
[root@localhost ~]#
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
パスワード変更
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[root@localhost ~]# chage -l admin
Last password change : 12月 30, 2007
Password expires : 3月 29, 2008
Password inactive : 4月 05, 2008
Account expires : 4月 01, 2010
Minimum number of days between password change : 1
Maximum number of days between password change : 90
Number of days of warning before password expires : 30
[root@localhost ~]#
※ 一般ユーザーのログインを禁止する設定
/etc/nologinファイルを作成しておく。 (touch /etc/nologin)
※ usermod -s /bin/false ユーザー名 (特定ユーザーのログイン禁止)
※ /etc/passwdファイルを直接編集でも可
ユーザーのリソース利用制限をulimitにて変更できます。
[root@localhost ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
max nice (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 5119
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
max rt priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 5119
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@localhost ~]#