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

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.

主站蜘蛛池模板: 金寨县| 阳泉市| 厦门市| 仁怀市| 崇州市| 沂源县| 潜山县| 普兰店市| 沈丘县| 南京市| 冕宁县| 茌平县| 称多县| 汕头市| 寻甸| 赤壁市| 英超| 新余市| 工布江达县| 龙门县| 保定市| 永川市| 布尔津县| 宁海县| 会同县| 舒兰市| 金川县| 临夏市| 固阳县| 响水县| 巩义市| 铜陵市| 吉林市| 库伦旗| 兴海县| 民勤县| 眉山市| 涟水县| 黔东| 商都县| 刚察县|