RHEL 7 – RHCSA Notes (Cheat Sheets)SELinux modes SELinux gives that extra layer of security to the resources in the system. It provides the MAC (mandatory access control) as contrary to the DAC (Discretionary access control). Before we dive into setting the SELinux modes, let us see what are the different SELinux modes of operation and how do they work. SELinux can operate in any of the 3 modes :1. Enforced : Actions contrary to the policy are blocked and a corresponding event is logged … [Read more...] about RHEL 7 – RHCSA Notes – Set enforcing and permissive modes for SELinux
RHEL 7 – RHCSA Notes (Cheat Sheets)The file access control lists (FACLs) or simply ACLs are the list of additional user/groups and their permission to the file. Although the default file permissions does their jobs perfectly, it does not allow you to give permissions to more than one user or one group on the same file.How to know when a file has ACL attached to it ls -l command would produce a output as show below. Note the + sign at the end of the permissions. This confirms that the … [Read more...] about RHEL 7 – RHCSA Notes – Create and manage Access Control Lists (ACLs)
RHEL 7 – RHCSA Notes (Cheat Sheets)Password configuration password aging requires users to change their password periodically. Use the chage to configure password expiration. The syntax is : # chage [options] user_name - When you fire the command chage, the currently set options are displayed as well. # chage oracle Changing the aging information for oracle Enter the new value, or press ENTER for the defaultMinimum Password Age : Maximum Password Age : Last Password … [Read more...] about RHEL 7 – RHCSA Notes : Change passwords and adjust password aging for local user accounts
RHEL 7 – RHCSA Notes (Cheat Sheets)Group administration - Use the groupadd command to add a new group : # groupadd [options] group_name - Use the groupmod command to modify an existing group : # groupmod [options] group_name - Use groupdel to delete the group. You can remove a group even if there are users in the group. But you can not remove the primary group of an existing user. You must remove the user before removing the group. # groupdel group_name - Use the gpasswd command to … [Read more...] about RHEL 7 – RHCSA Notes : Create, delete, and modify local groups and group memberships.
RHEL 7 – RHCSA Notes (Cheat Sheets)Adding a user account Use the useradd command to add new user : # useradd [options] [username] The default settings for new user can viewed and modified using the -D option : # useradd -D GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel CREATE_MAIL_SPOOL=yesFor example, to change the default user shell for new user to /bin/ksh : # useradd -D -s /bin/kshExamples To simple add a user with all default options : # … [Read more...] about RHEL 7 – RHCSA Notes : Create, delete, and modify local user accounts
RHEL 7 – RHCSA Notes (Cheat Sheets)RHEL 7 has 3 command-line utilities to configure the system date and time: 1. date 2. hwclock 3. timedatectldate command Use the date command to display or set the system date and time. Run the date command with no arguments to display the current date and time: # date Mon Sep 12 19:41:40 IST 2016The date command provides a variety of output formatting options. You can also time and date in future or past. Few examples are given below. 1. … [Read more...] about RHEL 7 – RHCSA Notes : Configure a system to use time services
RHEL 7 – RHCSA Notes (Cheat Sheets)- Linux can run tasks automatically, and comes with automated tasks utilities: cron, anacron, at, batch. - cron jobs can run as often as every minute. - A scheduled cron job is skipped if the system is down. - anacron can run a job only once a day. - Scheduled jobs are remembered and run the next time that the system is up. - crond daemon searches multiple files and directories for scheduled jobs: 1. /var/spool/cron/ 2. /etc/anacrontab 3. … [Read more...] about RHEL 7 – RHCSA Notes : Schedule tasks using at and cron
RHEL 7 – RHCSA Notes (Cheat Sheets)systemd service units - Previous versions of Oracle Linux use scripts in the /etc/rc.d/init.d directory to control services. - In Oracle Linux 7, these scripts have been replaced by systemd service units. - Use the systemctl command to list information about service units.To list all loaded service units: # systemctl list-units --type service --all To see which service units are enabled: # systemctl list-unit-files --type serviceDisplaying the … [Read more...] about RHEL 7 – RHCSA Notes : Start, stop, and check the status of network services.
RHEL 7 – RHCSA Notes (Cheat Sheets)Soft links As shown in the diagram soft links or symbolic links simply points to another file. It only contains the pathname of the file to which it is pointing1. Creation method# touch file # ln -s file link # ls -l -rw-r--r-- 1 root root 0 Sep 19 14:41 link lrwxrwxrwx 1 root root 5 Sep 19 15:41 link -> fileThe "l" in the "ls -l" command output above indicates that the file is a soft link. 2. The size of the soft … [Read more...] about RHEL 7 – RHCSA Notes : Create hard and soft links.
RHEL 7 – RHCSA Notes (Cheat Sheets)Three standard file descriptors : 1. stdin 0 - Standard input to the program. 2. stdout 1 - Standard output from the program. 3. stderr 2 - Standard error output from the program.PurposeCommand redirect std output to filename> filename or 1> filename append std out to filename>> filename append std out and std err to filename>> filename 2>&1 or 1>> filename 2>&1 take input from filename< filename or 0 < filename redirect std error to … [Read more...] about RHEL 7 – RHCSA Notes – input / output redirection