Linux: 'Username' is not in the sudoers file. This incident will be reported

前端 未结 10 1968
南方客
南方客 2020-12-05 12:05

After logging into ssh, I got this message:

\'Username\' is not in the sudoers file. This incident will be reported.

How can I r

10条回答
  •  广开言路
    2020-12-05 12:14

    At the top of the aforementioned /etc/sudoers file there's an info:

    "## This file MUST be edited with the 'visudo' command as root."
    

    In order of doing as we're told, use:

    $ su
    > Enter root password: *******
    $ visudo -f /etc/sudoers
    

    Find the following section of /etc/sudoers file and add your users privileges:

    # User privilege specification
    root    ALL=(ALL:ALL) ALL
    user_name ALL=(ALL) ALL
    

    Save the file (press esc and type :x if vim is your default text editor, for nano press ctrl+o, enter and then ctrl+x).

    Type exit to turn off the root shell, and enjoy the power of sudo with your username

提交回复
热议问题