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

來源:互聯網
上載者:User

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就可以解鎖使用者。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.