Ubuntu不能使用passwd的--stdin的解決辦法


轉載請注明來源https://www.cnblogs.com/sogeisetsu/p/11397648.html

Ubuntu不能使用passwd的--stdin的解決辦法

可以使用chpasswd
看一下man chpasswd

DESCRIPTION
       The chpasswd command reads a list of user name and password pairs from standard input and uses this information to update a group of
       existing users. Each line is of the format:

       user_name:password

所以可以echo username:newoasswd | chpasswd
username是用戶名,newpasswd是新密碼。值得注意的是echo后面不要忘了加引號把用戶名和新密碼引起來
最后說一個事情,目前發現Ubuntu的16.1系統沒有--stdin和/etc/rc.local,所以建議大家初學Linux不要用Ubuntu。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM