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

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.

主站蜘蛛池模板: 南部县| 余姚市| 天祝| 江永县| 六盘水市| 太仆寺旗| 镶黄旗| 额尔古纳市| 南靖县| 中江县| 德庆县| 兴和县| 新营市| 三门县| 屯门区| 琼结县| 全椒县| 柘荣县| 米脂县| 当雄县| 九龙城区| 芒康县| 儋州市| 廊坊市| 兴宁市| 呼和浩特市| 宝坻区| 临武县| 永定县| 会同县| 长治县| 东明县| 清涧县| 张掖市| 内丘县| 朝阳县| 海宁市| 灌南县| 体育| 天峻县| 两当县|