Redhat certified System Administrator (EX200)
Servera (Node 1)
Manage Networking
NETMASK = 255.255.255.0
GATEWAY = 172.25.250.254
Nameserver = 172.25.250.254
Hostname = node1.example.com
Answer:
Set Up IP Address
[root@node1 ~] # nmcli connection show
[root@node1 ~] #
nmcli connection up "Wired connection 1"
[root@node1 ~] # nmcli connection reload
- Wired connection 1 means your interface name.
- In exam- interface name have Wired Connection 1.
- Normally it has en160 on VM or Physical machine.
Set Up Hostname
[root@node1 ~] # hostnamectl status
Or
vi /etc/hostname
Extra- Enable SSH
[root@node1 ~] # rpm -q openssh (check if package installed or not)
[root@node1 ~] # dnf install -y openssh.server (if not install ssh)
[root@node1 ~] # nmcli connection show
[root@node1 ~] # systemctl start sshd
[root@node1 ~] # systemctl enable sshd
[root@node1 ~] # firewall-cmd --permanent --add-service=ssh
[root@node1 ~] # firewall-cmd --permanent --add-port=22/tcp
[root@node1 ~] # firewall-cmd –reload
Permit Root Login from Remote--
[root@node1 ~] # vi /etc/ssh/sshd_config
[root@node2 ~] # ssh root@172.25.250.10 (Remote login from Node 2)
--------------------------------------------------------------------------------------------------------------------------Installing and Updating Software Packages
http://content.example.com/rhel9.0/x86_64/rhcsa-practice/rht
http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata
Answer:
For Exam
[root@node1 ~] # vim /etc/yum.repos.d/exam.repo
[BaseOS]
name=BaseOS
baseurl=
http://content.example.com/rhel9.0/x86_64/rhcsa-practice/rht
enabled=1
gpgcheck=0
[AppStream]
name=AppStream
baseurl= http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata
enabled=1
gpgcheck=0
Repo Server-Local
or
[root@node1~]# df -h
[root@node1~]# mkdir -p /mnt/cdrom
[root@node1~]# mount /dev/sr0 /mnt/cdrom
[root@node1~]# mkdir /rhel9
[root@node1~]# cd /rhel9
[root@node1~]# cp -rf /mnt/cdrom/* .
Ø cp: Copy files and directories
Ø -r: Recursively copy all files and subdirectories
Ø -f: Force overwrite any existing files in the destination
Ø /mnt/cdrom/*: All files and directories in
/mnt/cdrom/.
Ø . Current directory (destination)
[root@node1~]# lsblk (Show /mnt directory)
or
[root@node1~]# df -H
or
or
[root@node1~]# cd /etc/yum.repos.d/
[BaseOS]
name=RHEL9
Base OS
baseurl=file:///rhel9/BaseOS
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[AppStream]
name=RHEL9
ApStream
baseurl=file:///rhel9/AppStream
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@node1~]# createrepo -v /rhel9
Disable subscription manager
from enabled=1
to
enabled=0
[root@node1~]# yum repolist
[root@node1~]# dnf clean all (clean cache)
[root@node1~]# dnf install -y httpd
Repo Server With HTTP
[root@node1~]# systemctl enable --now httpd
[root@node1~]# mv /rhel9 /var/www/html
Or
[root@node1~]# restorecon -Rv /var/www/html
[root@node1~]# firewall-cmd --permanent --add-service=http
[root@node1~]# firewall-cmd --permanent --add-port=80/tcp
[root@node1~]# firewall-cmd --reload
[root@node1~]# firewall-cmd --list-all
Client add With HTTP
sudo dnf config-manager --add-repo=http://10.10.10.91/rhel9/BaseOS
sudo dnf config-manager --add-repo=http://10.10.10.91/rhel9/AppStream
-- Now modify those two files to include gpgcheck and gpgkey parameters as below
gpgcheck=1
gpgkey=http://10.10.10.91/rhel9/BaseOS
gpgcheck=1
gpgkey=http://10.10.10.91/rhel9/AppStream
----------------------------------------------------------------------------------------------------------------------
Managing Local Users and Groups
· A user harry who belongs to sharegrp as a secondary group
· A user natasha who also belongs to sharegrp as a secondary group
· A user copper who does not have access to an interactive shell on the system and who is not a member of sharegrp.
· harry, natasha and copper should have the password redhat
Answer:
[root@node1~] # useradd -G sharegrp harry
[root@node1~] # useradd -G sharegrp natasha
[root@node1~] # useradd -s /sbin/nologin copper
[root@node1~] # passwd harry
[root@node1~] # passwd natasha
[root@node1~] # passwd copper
Optional:
[root@node1~] # useradd user1 && echo "user1:12345" | chpasswd (New User add and set password)
For verification:
[root@node1~] # tail -5 /etc/group
[root@node1~] # tail -5 /etc/shadow
Controlling Access to Files
·
Create collaborative directory
/var/shares with
the following characteristics:
·
Group ownership of /var/shares should be sharegrp.
· The directory
should be readable,
writable and accessible to member of sharegrp but
not to any other user. (It is understood that root has access to all
files and directories on the system)
· Files created
in /var/shares automatically have group ownership
set to the sharegrp
group.
Answer:
[root@node1~] # mkdir -p /var/shares
[root@node1~] # ls -ld /var/shares
[root@node1~] # chgrp sharegrp /var/shares/
Or
[root@node1~] # chown :sharegrp /var/shares/
[root@node1~] # ls -ld /var/shares
[root@node1~] # chmod 770 /var/shares
[root@node1~] # chmod 2770 /var/share
--------------------------------------------------------------------------------------------------------------
Answer:
<comment xml:lang="ast">Ficheru codificáu en BinHex de Machintosh</comment>
<comment xml:lang="fr">fichier codé Macintosh BinHex</comment>
<comment xml:lang="gl">ficheiro de Macintosh codificado con BinHex</comment>
<comment xml:lang="oc">fichièr encodat Macintosh BinHex</comment>
<comment xml:lang="pt">ficheiro codificado em BinHex de Macintosh</comment>
<comment xml:lang="fr">fichier boîte aux lettres</comment>
<comment xml:lang="gl">ficheiro de caixa de correo</comment>
.......…………………. output omitted……………………………….
0 Comments