Sticky bit
- Sticky is a special permission that cna be used to prevent users from deleting other users files and directories
- Root user can ofcourse delete this, but not others users
- Adding stick bit to use +t in chmod
- If we add chmod +t to files/directories others users cannot delete it, but if the other user is sudoer or super user they can delete
visudo
- visudo is a command that helps in editing sudoers file.
- since its not a good idea to change /etc/sudoers file directly, visudo command can help in editing sudoers file
- visudo edits the sudoers file, which defines the users and groups with administrative rights
- Now execute the command visudo from root user
- any line which starts with # is comment
- In this file root ALL=(ALL:ALL) ALL states that the user root, may run as any user or group , any command
- Syntax of directive
user hostname=(runas-user:runas-group) command
- If the user in the directive begins with %, it is group
%admin ALL=(ALL) ALL
%sudo ALL=(ALL:ALL) ALL
%wheel ALL=(ALL) ALL
- For sudo users when execute sudo password/key is expected, to ensure linux doesn’t ask passwords when we use sudo command
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
%wheel ALL=(ALL) NOPASSWD:ALL
Managing Softwares in Linux
- A good chunk of time as sys admin/devops will be spent in managing the various softwares/applications.
- When we install any software, we would be running them. In this running/executing there are two kinds of softwares
- Software which executes only when the user executes the command
- Software which run all the time in background. In linux any program that runs in the background is called as daemon.
Approaches of installing software in linux
-
From source code:
- Copy the source code in linux
- compile the source code (make tools)
- copy the executables into the folders of your choice
- Add folders to PATH variables (if required)
- Example: Look into nagios installation Refer Here
-
From executables:
- Software executables will be shared to you as tar/zip files
- untar the files, copy them to folders of your choice and execute applications
-
Package Managers:
- will be discussed in next class