3、鎖定賬號 newuser1 # usermod -L newuser1 4、解除對 newuser1 的鎖定 # usermod -U newuser1
如何查看賬戶被鎖定
cat /etc/shadow
被鎖定賬戶的加密字段前面會有!或者*
例子
下面這個是正常的賬戶 aaaaa:
6
6
6GbTLDyfkhFeB$4TJlZ3/ZFnWg7TSrS1.NuAyMEPn6TgaoZgi/Ah9OC489l8aPE9YWnDyS2dDLzhFwtq2y/U87HBc4K8WAFPuCC0:17616:0:90:7:::
下面這個是鎖定的賬戶
aaaaa:!666GbTLDyfkhFeB$4TJlZ3/ZFnWg7TSrS1.NuAyMEPn6TgaoZgi/Ah9OC489l8aPE9YWnDyS2dDLzhFwtq2y/U87HBc4K8WAFPuCC0:17616:0:90:7:::