Root Permission to SSH User

Today we will learn how to provide root permission to your SSH user.

So, We can provide SSH user root permission either move them in root user group or We can add simple line in sudoers file to provide root permission.

Lets use the first method.

Provide ROOT permission to this user by move it to root user.

1usermod -aG sudo <USER-NAME>

By default, on CentOS, members of the wheel group have sudo privileges. So, Run below command:

1usermod -aG wheel <USER-NAME>

In second method, we will write simple lines in sudoers file.

  • Open sudoers file by entering below command:
1sudo visudo
  • Now add below line in the file, to provide root permission without password:
  • Also, you can provide root permission with password using below command:
1user-name ALL=(ALL) ALL

Note: Change user-name with your Linux user name.

Default sudoers file path is /etc/sudoers*

I :heart: AWS! :smile: Enjoy