1、账号和口令
主要是/etc/passwd和/etc/shadow两个文件,/etc/passwd主要是存放账户,/etc/shadow主要是存放用户口令。
[root@Linux ~]# ls -l /etc/passwd
-rw-r--r-- 1 root root 1479 Aug 26 16:44 /etc/passwd
-r-------- 1 root root 967 Aug 26 16:44 /etc/shadow
这里主要对用户的口令作一些基础的讲解,主要是口令要主要一些方面:
1、复杂性
一般不要将口令设置为自己的名字,生日号码,一些容易被猜中的简单的数字和英文单词。一般字母,数字、符号相组合。但是不能设置的太复杂,要自己使用要方便。
一般来说设置8个字符以上的密码才算是比较安全,但不一定要设置8个字符,只要有一定的复杂性,密码一般都不会被别人破解
建议一般是一个月左右更改一个口令,可以更改以下文件来达到目的
-rw-r--r-- 1 root root 1503 Jan 9 2008 /etc/login.defs
[root@Linux ~]# cat /etc/login.defs
# *REQUIRED*
# Directory where mailboxes reside, _or_ name of file, relative to the
# home directory. If you _do_ define both, MAIL_DIR takes precedence.
# QMAIL_DIR is for Qmail
#
#QMAIL_DIR Maildir
MAIL_DIR /var/spool/mail
#MAIL_FILE .mail
#
# PASS_MAX_DAYS Maximum number of days a password may be used.
# PASS_MIN_DAYS Minimum number of days allowed between password changes.
# PASS_MIN_LEN Minimum acceptable password length.
# PASS_WARN_AGE Number of days warning given before a password expires.
#
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5
PASS_WARN_AGE 7
# 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
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
#USERDEL_CMD /usr/sbin/userdel_local
# If useradd should create home directories for users by default
# On RH systems, we do. This option is overridden with the -m flag on
# useradd command line.
#
CREATE_HOME yes
# the permission mask will be initialized to 022.
UMASK 077
#
USERGROUPS_ENAB yes
MD5_CRYPT_ENAB yes