ubuntu 16.04 忘记root密码

别人刚装的Ubuntu16.04 sever,root忘记了,哎。

1.进入recovery mode

  开机选择高级模式-> recovery mode->root

2.修改密码:

  #> passwd root

  显示错误:

  root@username-PC:~# passwd username
  Enter new UNIX password:
  Retype new UNIX password:
  passwd: Authentication token manipulation error
  passwd: password unchanged
 网上说是因为recovery mode下的根分区是以只读的方式挂载的,所以需要重新挂载:
#> mount -rw -o remount /
OK 问题解决

  原文链接:http://askubuntu.com/questions/91188/authentication-token-manipulation-error