歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> usermod鎖定賬戶和passwd鎖定賬戶的區別,usermodpasswd

usermod鎖定賬戶和passwd鎖定賬戶的區別,usermodpasswd

日期:2017/3/6 9:22:03   编辑:學習Linux

usermod鎖定賬戶和passwd鎖定賬戶的區別,usermodpasswd


usermod鎖定賬戶和passwd鎖定賬戶的區別,usermodpasswd


摘自:http://www.apelearn.com/bbs/thread-6658-1-1.html

passwd -l 鎖定賬戶,在密碼字符串的前面加上!。

passwd -u是去掉密碼字符串前面的!。

usermod -L 默認只是鎖定密碼,在密碼字符串前面加!。

usermod -U默認只是解鎖密碼,去掉密碼字符串前面的!。

首先將user1用passwd鎖定、test用usermod鎖定,如圖1。

圖1:

可以看到user1的密碼前面加了!!,而test密碼前面加了!。

然後用兩次usermod -U 給user1解鎖,如圖2、圖3。

圖2:

圖3:

用user1可以正常登錄,如圖8。

圖4:

我個人理解,無論是鎖定賬戶還是鎖定密碼,其實就是在賬戶的密碼密碼前面加上!,不管是哪種解鎖方式都是去掉密碼前面的!。
usermod不能一次解鎖passwd鎖定的賬戶,是因為passwd鎖定的賬戶前面有兩個!,usermod只是去掉一個!,所以進行兩次usermod就可以解鎖用戶。

http://xxxxxx/Linuxjc/1151179.html TechArticle

Copyright © Linux教程網 All Rights Reserved