Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
ive663 committed Jun 3, 2023
1 parent e945a11 commit bc6915c
Show file tree
Hide file tree
Showing 149 changed files with 11,643 additions and 2 deletions.
771 changes: 771 additions & 0 deletions Abdulhamid97Mousa/EX200-Exam-Questions/README.md

Large diffs are not rendered by default.

4,693 changes: 4,693 additions & 0 deletions Abdulhamid97Mousa/README.md

Large diffs are not rendered by default.

101 changes: 99 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,99 @@
# RHCSA
the collection of practice questions and lab environment for ex200
# RHCSA...
the collection of practice questions and lab environment for ex200 from all around github...


[**Red Hat Certified System Administrator (RHCSA)** exam objectives](https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam?section=objectives)

**Study points for the exam**

RHCSA exam candidates should be able to accomplish the tasks below without assistance. These have been grouped into several categories.


**Understand and use essential tools**
- Access a shell prompt and issue commands with correct syntax
- Use input-output redirection (>, >>, |, 2>, etc.)
- Use grep and regular expressions to analyze text
- Access remote systems using SSH
- Log in and switch users in multiuser targets
- Archive, compress, unpack, and uncompress files using tar, star, gzip, and bzip2
- Create and edit text files
- Create, delete, copy, and move files and directories
- Create hard and soft links
- List, set, and change standard ugo/rwx permissions
- Locate, read, and use system documentation including man, info, and files in /usr/share/doc

**Create simple shell scripts**
- Conditionally execute code (use of: if, test, [], etc.)
- Use Looping constructs (for, etc.) to process file, command line input
- Process script inputs ($1, $2, etc.)
- Processing output of shell commands within a script

**Operate running systems**
- Boot, reboot, and shut down a system normally
- Boot systems into different targets manually
- Interrupt the boot process in order to gain access to a system
- Identify CPU/memory intensive processes and kill processes
- Adjust process scheduling
- Manage tuning profiles
- Locate and interpret system log files and journals
- Preserve system journals
- Start, stop, and check the status of network services
- Securely transfer files between systems

**Configure local storage**
- List, create, delete partitions on MBR and GPT disks
- Create and remove physical volumes
- Assign physical volumes to volume groups
- Create and delete logical volumes
- Configure systems to mount file systems at boot by universally unique ID (UUID) or label
- Add new partitions and logical volumes, and swap to a system non-destructively

**Create and configure file systems**
- Create, mount, unmount, and use vfat, ext4, and xfs file systems
- Mount and unmount network file systems using NFS
- Configure autofs
- Extend existing logical volumes
- Create and configure set-GID directories for collaboration
- Diagnose and correct file permission problems

**Deploy, configure, and maintain systems**
- Schedule tasks using at and cron
- Start and stop services and configure services to start automatically at boot
- Configure systems to boot into a specific target automatically
- Configure time service clients
- Install and update software packages from Red Hat Network, a remote repository, or from the local file system
- Modify the system bootloader

**Manage basic networking**
- Configure IPv4 and IPv6 addresses
- Configure hostname resolution
- Configure network services to start automatically at boot
- Restrict network access using firewall-cmd/firewall

**Manage users and groups**
- Create, delete, and modify local user accounts
- Change passwords and adjust password aging for local user accounts
- Create, delete, and modify local groups and group memberships
- Configure superuser access

**Manage security**
- Configure firewall settings using firewall-cmd/firewalld
- Manage default file permissions
- Configure key-based authentication for SSH
- Set enforcing and permissive modes for SELinux
- List and identify SELinux file and process context
- Restore default file contexts
- Manage SELinux port labels
- Use boolean settings to modify system SELinux settings
- Diagnose and address routine SELinux policy violations

**Manage containers**
- Find and retrieve container images from a remote registry
- Inspect container images
- Perform container management using commands such as podman and skopeo
- Build a container from a Containerfile
- Perform basic container management such as running, starting, stopping, and listing running containers
- Run a service inside a container
- Configure a container to start automatically as a systemd service
- Attach persistent storage to a container
- As with all Red Hat performance-based exams, configurations must persist after reboot without intervention.
13 changes: 13 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/ACL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### **Q. copy /etc/fstab to /var/tmp. user natasha has read and write permission, user sarah has no any permission to /var/tmp**
### Answer :-
```
[root@localhost ~]# cp /etc/fstab /var/tmp
[root@localhost ~]# getfacl /var/tmp (check permissions)
[root@localhost ~]# setfacl -m u:natasha:rw- /var/tmp
[root@localhost ~]# setfacl -m u:sarah:--- /var/tmp
[root@localhost ~]# getfacl /var/tmp (again check permissions)
```
21 changes: 21 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/Create_partition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### **Q. Create a 2GB partition using /dev/sdb make it as ext4 file system and mounted automatically under /mnt/data at boot-start**
### Answer : -
```
[root@localhost ~]# fdisk /dev/sdb
command (m for help): press 'n' here
select (default p): Enter
partition number (1-4, default between 1-4): Enter
first sector(default): Enter
last sector, sector or +size (K,M,G,T,P)(default): +2G
command (m for help): press p for partition info
command (m for help): press w to save changes
[root@localhost ~]# udevadm settle (to setup driver)
[root@localhost ~]# mkfs.ext4 /dev/sdb1 (here sdb1 is partition in /dev/sdb)
[root@localhost ~]# mkdir /mnt/data
[root@localhost ~]# mount /dev/sdb1 /mnt/data
To mount a partition automatically under /mnt/data make the entry of partition in /etc/fstab file. use following command:
[root@localhost ~]# vim /etc/fstab (add partition entry here)
7 changes: 7 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/Creating_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Q. **Create a group usergroup with 1788 groupid**.
### Answer :-
```
[root@localhost ~]# groupadd -g 1788 usergroup
[root@localhost ~]# cat /etc/group (checkout groups and id's)
```
13 changes: 13 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/Enabling_SELinux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### <cneter>**Q. Enable SELinux.**</center>
### Answer: -
```
[root@localhost ~]# getenforce (checks status of SELinux)
if it shows disabled or permissive go to /etc/selinux/config file and change configuration of selinux as,
SELINUX=enforcing
[root@localhost ~]# systemctl reboot
Again check status of SELinux after reboot.
```
25 changes: 25 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/Network_configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### **Configure Host Name, IP address, Gateway and DNS**
### Host Name --> station.domain40.example.com
### IP address --> 172.24.40.40
### Gateway --> 172.24.40.1
### DNS -->172.24.40.1

### Answer :-

```
[root@localhost ~]# hostnamectl set-hostname station.domain40.example.com
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
- Things needs to be configured are
BOOTPROTO=static
ONBOOT=yes
IPADDR=172.24.40.40
GATEWAY=172.24.40.1
DNS1=172.24.40.1
[root@localhost ~]# cat /etc/resolv.conf (check DNS configuration)
28 changes: 28 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/Stratis_pool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
### **Q. Create a stratis pool of size 2GB with name newpool and create a filesystem with name newpart1 it should be mounted on /mnt/partition.**
### Answer: -
Install neccessay packages to do this task.
- yum install stratisd
- yum install stratis-cli

procedure to create stratis pool.
```
[root@localhost ~]# yum install stratisd
[root@localhost ~]# yum enable stratisd
[root@localhost ~]# stratis pool create newpool /dev/sdb (here /sdb is disk of size 2GB)
[root@localhost ~]# stratis pool list (checkout pools)
[root@localhost ~]# stratis filesystem newpool newpart1 (creates filesystem)
[root@localhost ~]# stratis filesystem list (check filesystem)
[root@localhost ~]# mkdir /mnt/partition
[root@localhost ~]# mount /stratis/newpool/newpart1 /mnt/partition
To mount a partition automatically under /mnt/partition make the entry of partition in /etc/fstab file. use following command:
[root@localhost ~]# vim /etc/fstab (add partition entry here)
```
12 changes: 12 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/User_creation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### ***Create a user named Eric, and the user id should be 1234, and the password should be Eric123.***
### Answer :-
```
[root@localhost ~]# useradd -u 1234 Eric
[root@localhost ~]# passwd Eric
changing password for user Eric
New password:Eric123
Retype new password:Eric123
passwd: all authentication token updated successfully.
20 changes: 20 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/User_permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### **Q.Copy /etc/fstab to /var/tmp name admin, the user1 could read, write and modify it, while user2 without any permission.**
### Answer :-
```
[root@localhost ~]# cp /etc/fstab /var/tmp
[root@localhost ~]# groupadd admin
[root@localhost ~]# useradd user1
[root@localhost ~]# useradd user2
[root@localhost ~]# chgrp admin /var/tmp/fstab
[root@localhost ~]# getfacl /var/tmp/fstab (check owner, group and permissions)
[root@localhost ~]# setfacl -m u:user1:rwx /var/tmp/fstab
[root@localhost ~]# setfacl -m u:user2:--- /var/tmp/fstab
[root@localhost ~]# getfacl /var/tmp/fstab (again check group, and user permissions)
```
11 changes: 11 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/change_tunning_profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### **Q. Change the current active tuning profile to powersave**
### Answer :-
```
[root@localhost ~]# tuned-adm list (command gives list of available profile)
[root@localhost ~]# tuned-adm profile powersave
to confirm that powersave profile is active, execute following command
[root@localhost ~]# tuned-adm active
```
35 changes: 35 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/create_swap_partition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### **Q. Add aditional swap partition of 2GB using /dev/sdd? and mount it permanently.**
### Answer:-
```
[root@localhost ~]# lsblk (check description of partitions)
[root@localhost ~]# fdisk /dev/sdd
command (m for help): press 'n' here
select (default p): Enter
partition number (1-4, default between 1-4): Enter
first sector(default): Enter
last sector, sector or +size (K,M,G,T,P)(default): +2G
command (m for help): press p for partition info
now we need this partition to be swap partition. hence we need to change the flag.
command (m for help): press 't' here
partition number (default 1): enter
change the partition regular to swap use hex code 82.
Hex code (type L to list all hex code): 82
changed type of partition 'Linux' to 'Linux swap'
command (m for help): press w to save changes
[root@localhost ~]# partprobe
[root@localhost ~]# mkswap /dev/sdd1
[root@localhost ~]# swapon /dev/sdd1
[root@localhost ~]# swapon -s (check swap summary)
To mount swap permanently make entry in fstab
[root@localhost ~]# vim /etc/fstab
```

13 changes: 13 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/create_user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### <center>**Add user Krish such that it's password not gonna expire.**
### Answer :-
```
[root@localhost ~]# useradd -h (get help to checkout options for password inactive period)
Graphical window appears
select -f to option to decide password period.
[root@localhost ~]# useradd -f -1 Krish
here password expiry value is -1 which means not expiry period.
```
11 changes: 11 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/cronjob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### ***Q. Configure a cronjob that runs 14:10 minutes and executes, logger"Target EX200" at the user Krish.***
### Answer :-

```
[root@localhost ~]# crontab -eu Krish
10 14 * * *logger"Target EX200"
[root@localhost ~]# crontab -l (check cronjob)
```
16 changes: 16 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/find_files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### **Q.Locate all files owned by user Eric and copy all those files under /root/Eric-files**
### Answer : -
```
[root@localhost ~]# mkdir /root/Eric-files
[root@localhost ~]# find / -user Eric (finds all files owned by Eric user)
/tmp/hello.txt
/tmp/hi.txt
[root@localhost ~]# cp /tmp/hello.txt /root/Eric-files (copy files owned by eric user)
[root@localhost ~]# cp /tmp/hi.txt /root/Eric-files
[root@localhost ~]# ls -la /root/Eric-files (check whether all files copied or not)
```
5 changes: 5 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/findwords.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### **Q. Find string empty in /usr/share/dict/words and put into /root/emptyword.**
### Answer :-
```
[root@localhost ~]# grep empty /usr/share/dict/words > /root/emptyword.
```
15 changes: 15 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### **Q. Add three users: harry, natasha, tom. The requirements: The Additional group of the two users: harry, Natasha is the admin group. The user: tom's login shell should be non-interactive.**
### Answer :-
```
[root@localhost ~]# groupadd admin
[root@localhost ~]# useradd -G admin harry
[root@localhost ~]# useradd -G admin natasha
[root@localhost ~]# cat /etc/group (check group and group members)
[root@localhost ~]# useradd -s /sbin/nologin tom
[root@localhost ~]# cat /etc/passwd (check login shell)
```
11 changes: 11 additions & 0 deletions SHrEE-7/Practice_Exam-Questions/modify_user_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### **Q. Change user krish user id from 1200 to 1284.**
### Answer :-
```
checkout uid of user krish
[root@localhost ~]# id krish
uid=1200(krish) gid=1201(krish) groups=1201(krish)
[root@localhost ~]# usermod -u 1284 krish
uid=1284(krish) gid=1201(krish) groups=1201(krish)
```
Loading

0 comments on commit bc6915c

Please sign in to comment.