Guangcun's Blog分享 http://blog.sciencenet.cn/u/gcshan 哥伦比亚大学访问学者,香港城市大学校董 (2011-2012)

博文

How to Lock / UnLock (Enable / Disable) Linux User Account

已有 3132 次阅读 2014-2-22 18:54 |个人分类:科学札记|系统分类:科研笔记| Linux

How to Lock / UnLock (Enable / Disable) Linux User Account
Before you remove an account from a system, is a good idea lock it for one week to make sure that no one use it.

To lock, you can use the follow command:
# passwd -l username (where username is the login id).
This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).

After that, if someone try to loginusing this account, the system will return:
# su - username
This account is currently not available.

To Unlock the same account
Following command re-enables an account by changing the password back to its previous value i.e. to value before using -l option.
# passwd -u username
This removes the '!' in front of the encrypted password

Read more: http://linuxpoison.blogspot.de/2010/07/how-to-lock-unlock-enable-disable-linux.html#ixzz2u2yYkKLT




https://wap.sciencenet.cn/blog-417402-769907.html

上一篇:HERMES 2014, Materials Modelling Summer School, London
下一篇:How to calculate Green's function
收藏 IP: 141.5.13.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-29 03:15

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部