转载请注明来源https://www.cnblogs.com/sogeisetsu/p/11397648.html

可以使用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。

相关文章:

  • 2021-08-23
  • 2021-09-24
  • 2022-12-23
  • 2021-07-09
  • 2021-09-23
  • 2021-11-21
猜你喜欢
  • 2021-09-03
  • 2022-12-23
  • 2021-11-18
  • 2022-01-03
  • 2022-12-23
  • 2021-11-28
  • 2021-05-07
相关资源
相似解决方案