首先root 权限创建新用户及密码:

    1. sudo -i
    2. $ sudo adduser yzpeng
    3. root 18:42:52 ~
    4. $ sudo passwd yzpeng
    5. Changing password for user yzpeng.
    6. New password:
    7. BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
    8. Retype new password:
    9. passwd: all authentication tokens updated successfully.

    接着进入新用户,并添加PS1 值:

    su -l yzpeng
    $ cat >> ~/.bashrc
    PS1="\[\033]2;\h:\u \w\007\033[33;1m\]\u \033[35;1m\t\033[0m \[\033[36;1m\]\w\[\033[0m\]\n\[\e[32;1m\]$ \[\e[0m\]"
    

    检查一下文件/etc/sudoers,确保下面这行没有被注释:

    ## Allows people in group wheel to run all commands
    %wheel ALL=(ALL) ALL
    

    接着在root 用户下,将新用户添加到root 组并查看:

    $ groups yzpeng
    yzpeng : yzpeng
    yzpeng 18:47:35 ~
    $ groups root
    root : root
    
    usermod -g root yzpeng
    $ groups yzpeng
    yzpeng : root
    

    就可以快乐使用了!