DEV Community

sathishkumar balachandran
sathishkumar balachandran

Posted on

Linux for Troubleshooting - sudo

Sudo :

  1. Root user - Critical operations are taken care.
  2. sudo or su do
  3. root binary setuid
  4. /etc/sudoers - default sudo security policy pulgin - this file defines who can run what .

Why we need sudo ?

Risk - to avoid normal user changing the configurations.
Think before you type.

sudo su --> changes to root in the terminal --> sudo useradd techie

  1. Lets give this user a root access
  2. Important file is /etc/sudoers

Image description

Image description

Image description

Image description

  1. sudo is more secure than su command.
  2. /var/log/secure or /var/log/auth.log --> logs that store sud usage.
  3. Below one shows the logs in auth .

Image description

Image description

Another important file is /etc/passwd

Once the user is getting created , it stores the data in the passwd file with password . If there is not password then ' x ' won't be there. (TBD)

Image description

Image description

Image description

Image description

Installing Programs :

  1. rpm - Package Manager or apt in some distro.
  2. Package Management System.
  3. .rpm - file format
  4. Yellowdog Updater or Modified Yum - Library - Utility

Image description

Image description

Image description

su command :

  1. command for the user
  2. Below user as root access .

Image description

Note :

  1. what is the meaning of this ? export VISUAL=vim; visudo (TBD)
  2. userdel for deleting the user also we can use 'f' to force the deletion. i.e., userdel -f Tom While deleting if the user is running some process we can use 'f' to force them.

Image description

Top comments (0)