- Forums
- Scripts
- How To Set Default Login Accounts
if you have a server like linux and you want to create account you can use the /etc/login.defs file to configure the default settings when a new user is created in your linux server, you can edit the /etc/login.defs ... [2817], Last Updated: Mon Jun 24, 2024
Webune Support
Thu Apr 29, 2010
1 Comments
424 Visits
if you have a server like linux and you want to create account you can use the /etc/login.defs file to configure the default settings when a new user is created in your linux server, you can edit the /etc/login.defs to change it however you want it, in its simplest way, you can send the useradd xxx to create a user. if you leave any parameters out the useradd will create a user with the default settings you have created in the /etc/login.defs file.
i think the .defs means 'defenitions' which is basically the same as the options, you can set up you server to be more secure if you want your users to reset the password every so often and when the password can expire an even the password legnth that you want to setup for each user when the useradd command is used. we recommend that you implement this login policy for your server if you are going to have to be the administrator of many users for you linux server that you have purchased from Webune. as an example, this is how the login.defs file looks like:
# *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
# Password aging controls:
#
# 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 is initialized to this value. If not specified,
# the permission mask will be initialized to 022.
UMASK 077
# This enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB yes
# Use MD5 or DES to encrypt password? Red Hat use MD5 by default.
MD5_CRYPT_ENAB yes
the chage command allows you to modify account settings relating to account expiration. it’s
possible to configure linux accounts so that they automatically expire if either of two conditions
is true:
the password hasn’t been changed in a specified period of time.
the system date is past a predetermined time.
the first option is generally used to enforce password changes—say, to get users to
change their passwords once a month. the second option is useful when an account should
exist for a specific limited period of time, such as until the end of an academic semester or until a temporary employee leaves. these settings are controlled through the chage utility,
which has the following syntax:
chage [-l] [-m mindays] [-m maxdays] [-d lastday] [-i inactivedays]
➥[-e expiredate] [-w warndays]
username
the program’s parameters modify the command’s actions:
display information the -l option causes chage to display account expiration and password
https://www.webune.com/forums/20100429cxcc.html