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