By default the regular user does not have an ability to execute commands with root privileges. As a result the following message will appear:
$ sudo -i
[sudo] password for linuxconfig:
linuxconfig is not in the sudoers file. This incident will be reported.
The objective is to gain a superuser ( root ) access on Redhat 7 Linux server using
Privileged root access to your Redhat 7 Linux server installation.
- # - requires given command to be executed with root privileges either directly as a root user or by use of
- $ - given command to be executed as a regular non-privileged user
Add user to WHEEL group
Using your current shell or log in as a root user execute the following command to add any user you wish to grant a sudo access. The example below will give a sudo access to
# usermod -G wheel linuxconfig
If you attempt to execute the
command now, you will still get the above error message unless you completely logout your user and re-login again:
If you are using GUI interface, the quickest way to apply the above changes is to logout and login from your graphical manager.
Executing command with sudo
Once you re-login you will be able to execute command as a privileged user: