카테고리 없음

RHCSA 12일차 뿌서짐

kiminaki 2021. 6. 30. 21:58

1. There is a local logical volumes in your system, named with common and belong to VGSRV volume group, mount to the /common directory. The definition of size is 128 MB.
Requirement:
Extend the logical volume to 190 MB without any loss of data. The size is allowed between 160-160 MB after extending.

lvextend -L 190M -r /dev/vg0/lv1

 

 

2. Create a swap space, set the size is 600 MB, and make it be mounted automatically after rebooting the system (permanent mount).

  103  fdisk /dev/sdb
  104  mkswap /dev/sdb1
  107  vi /etc/fstab

 

/dev/sdb1       swap    swap defaults   0 0

  108  swapon -a
  109  lsblk
  110  history

 

 

3. According the following requirements to create a local directory /common/admin.
This directory has admin group.
This directory has read, write and execute permissions for all admin group members.
Other groups and users don't have any permissions.
All the documents or directories created in the/common/admin are automatically inherit the admin group.

 

 

  103  mkdir -p /common/admin
  104  groupadd admin
  105  chown .admin /common/admin/
  106  chmod 2770 /common/admin/

 

 

 

 

4.User mary must configure a task.
Requirement: The local time at 14:23 every day echo "Hello World.".

 

  112  crontab -u mary -e

 

23 14 * * * /bin/echo "Hello World"

  113  crontab -l
  118  systemctl restart crond

 

 

5. Copy /etc/fstab document to /var/TMP directory. According the following requirements to configure the permission of this document.
✑ The owner of this document must be root.
✑ This document belongs to root group.
✑ User mary have read and write permissions for this document.
✑ User alice have read and execute permissions for this document.
✑ Create user named bob, set uid is 1000. Bob have read and write permissions for this document.
✑ All users has read permission for this document in the system.

 

cp /etc/fstab /var/tmp
chown root:root /var/tmp/fstab
chmod a-x /var/tmp/fstab
setfacl -m u:mary:rw /var/tmp/fstab
setfacl -m u:alice:rx /var/tmp/fstab
useradd -u 1000 bob

chmod a+r /var/tmp/fstab

 

 

6. Configure your web services, download from http://instructor.example.com/pub/serverX.html And the services must be still running after system rebooting.

 

yum -y install httpd

wget http://instructor.example.com/pub/serverX.html 

cp serverX.html /var/www/html/

systemctl restart httpd

 

7. SELinux must be running in the Enforcing mode.

 

vi /etc/sysconfig/selinuxSELINUX=enforcing

 

8. Create the following users, groups, and group memberships:
A group named adminuser.
A user natasha who belongs to adminuser as a secondary group A user harry who also belongs to adminuser as a secondary group.
A user sarah who does not have access to an interactive shell on the system, and who is not a member of adminuser, natasha, harry, and sarah should all have the password of redhat.

 

         groupadd adminuser
  105  useradd natasha
  106  useradd harry
  109  usermod -G adminuser harry
  110  usermod -G adminuser natasha
  113  usermod -s /sbin/nologin natasha
  115  passwd natasha 

  115  passwd harry

  115  passwd sarah

 

 

9. Set cronjob for user natasha to do /bin/echo hiya at 14:23.

crontab -e -u natasha
23 14 * * * /bin/echo hiya

systemctl restart crond

 

 

10. Configure autofs to automount the home directories of LDAP users as follows: host.domain11.example.com NFS-exports /home to your system.
This filesystem contains a pre-configured home directory for the user ldapuser11 ldapuser11's home directory is host.domain11.example.com /rhome/ldapuser11 ldapuser11's home directory should be automounted locally beneath /rhome as /rhome/ldapuser11
Home directories must be writable by their users
ldapuser11's password is 'password'.