官术网_书友最值得收藏!

Hands-on lab for setting account and password expiry data

In this lab, you'll create a couple of new user accounts, set expiration data, and view the results. You can do this lab on either the CentOS or the Ubuntu virtual machine. (The only difference will be with the useradd commands.)

  1. Create a user account for Samson with the expiration date of June 30, 2023, and view the results.

For CentOS:

        sudo useradd -e 2023-06-30 samson
sudo chage -l samson

For Ubuntu:

        sudo useradd -m -d /home/samson -s /bin/bash -e 2023-06-30
sudo chage -l samson
  1. Use usermod to change Samson's account expiration date to July 31, 2023:
        sudo usermod -e 2023-07-31
sudo chage -l samson
  1. Assign a password to Samson's account, then force him to change his password on his first login. Log in as Samson, change his password, then log back out to your own account:
        sudo passwd samson
sudo passwd -e samson
sudo chage -l samson
su - samson
exit
  1. Use chage to set a 5 day waiting period for changing passwords, a password expiration period of 90 days, an inactivity period of 2 days, and a warning period of 5 days:
        sudo chage -m 5 -M 90 -I 2 -W 5 samson
sudo chage -l samson
  1. Keep this account because you'll be using it for the lab in the next section.
主站蜘蛛池模板: 依安县| 嘉黎县| 肥乡县| 威信县| 玛纳斯县| 赣榆县| 安义县| 商丘市| 霍邱县| 新巴尔虎左旗| 开封县| 正镶白旗| 介休市| 都兰县| 德江县| 横峰县| 保德县| 凌云县| 武义县| 乌兰县| 呼和浩特市| 高阳县| 屏山县| 文安县| 从化市| 高平市| 江北区| 辰溪县| 阿图什市| 鄂托克旗| 深圳市| 河池市| 普定县| 甘孜县| 平凉市| 富平县| 昌平区| 满洲里市| 望奎县| 商水县| 泾阳县|