I have written two blogs earlier to help you understand sudo configuration and its function which you can follow using the below link
How to configure passwordless sudo for a user in Linux
How to give permission to user to run some commands in Linux
In this blog I will try to keep my self strictly to the point of issue. You might have noticed that at times when you try to execute a command using sudo user it prompts for root password.
As per this configuration ask for the password of the target user i.e. root.
How to configure passwordless sudo for a user in Linux
How to give permission to user to run some commands in Linux
In this blog I will try to keep my self strictly to the point of issue. You might have noticed that at times when you try to execute a command using sudo user it prompts for root password.
Reason:
You can see the below line in your /etc/sudoers fileDefaults targetpw
[deepak@test ~]$ sudo /etc/init.d/sshd restart
[sudo] password for root:
As per this configuration ask for the password of the target user i.e. root.
Solution:
To fix this comment out this line
Save and exit the file
Next try to use sudo for executing any command
# visudo
# Defaults targetpw
Save and exit the file
Next try to use sudo for executing any command
[deepak@test ~]$ sudo /etc/init.d/sshd restart
[sudo] password for deepak:
Follow the below links for more tutorials
Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
How to configure Samba 4 Secondary Domain Controller
How to secure Apache web server in Linux using password (.htaccess)
Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?
Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
How to configure Samba 4 Secondary Domain Controller
How to secure Apache web server in Linux using password (.htaccess)
Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?