方法:

    sudo passwd
    Password:你当前的密码
    Enter new UNIX password:这个是 root 的密码
    Retype new UNIX password:重复 root 的密码

但是输入完当前密码之后报如下错误,我的当前用户是appadmin:

    appadmin is not in the sudoers file. This incident has been reported to the administrator.

通过终端进入root之后执行如下命令:

    usermod -G sudo appadmin

再重新执行

    sudo passwd