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

Using usermod to lock a user account

Let's say that Katelyn has gone on maternity leave and will be gone for at least several weeks. We can lock her account with:

sudo usermod -L katelyn

When you look at Katelyn's entry in the /etc/shadow file, you'll now see an exclamation point in front of her password hash, as follows:

katelyn:!$6$uA5ecH1A$MZ6q5U.cyY2SRSJezV000AudP.ckXXndBNsXUdMI1vPO8aFmlLXcbGV25K5HSSaCv4RlDilwzlXq/hKvXRkpB/:17446:0:99999:7:::

This exclamation point prevents the system from being able to read her password, which effectively locks her out of the system.

To unlock her account, just follow this:

sudo usermod -U katelyn

You'll see that the exclamation point has been removed so that she can now log in to her account.

主站蜘蛛池模板: 额敏县| 凭祥市| 威宁| 平昌县| 靖宇县| 凭祥市| 万山特区| 依安县| 宣恩县| 恩平市| 轮台县| 法库县| 汝城县| 河南省| 阳新县| 饶河县| 奈曼旗| 大同县| 哈巴河县| 青河县| 上栗县| 武宁县| 神池县| 武威市| 郁南县| 西平县| 肇源县| 石渠县| 凤阳县| 临西县| 绥化市| 海丰县| 兴安盟| 华宁县| 乐清市| 腾冲县| 泰兴市| 渭源县| 张家港市| 赫章县| 锡林浩特市|