돌할우밤 공부방

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.

1. 시스템에 이름이 common으로 지정되고 VGSRV 볼륨 그룹에 속한 로컬 논리적 볼륨이 /common 디렉토리에 마운트됩니다. 크기의 정의는 128MB입니다.
요구 사항:
데이터 손실 없이 논리적 볼륨을 190MB로 확장 확장 후 160~160MB 사이에서 허용됩니다.

더보기

lvexntent -r -L 190M /dev/VSGRV/common

 

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

2. 스왑 공간을 생성하고 크기를 600MB로 설정한 후 시스템을 재부팅한 후 자동으로 마운트되도록 합니다(영구 마운트).

 

더보기

fdisk /dev/sdb

n - p - 기본 - +600M

t - 82

w

mkswap /dev/sdb1

vi /etc/fstab

/dev/sdb1          swap            swap            defaults           0 0 (:wq)

swapon -a

 

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.

3. 다음 요구 사항에 따라 로컬 디렉토리 /common/admin을 생성합니다.
이 디렉토리에는 관리자 그룹이 있습니다.
이 디렉토리에는 모든 관리 그룹 멤버에 대한 읽기, 쓰기 및 실행 권한이 있습니다.
다른 그룹 및 사용자에게는 권한이 없습니다.
/common/admin에서 생성된 모든 문서 또는 디렉터리는 자동으로 관리자 그룹을 상속합니다.

 

더보기

mkdir -p /common/admin

groupadd admin

chown .admin /common/admin

chmod 2770 /common/admin

 

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

4.사용자 mary는 태스크를 구성해야 합니다.
요구 사항: 현지 시간으로 매일 14시 23분에 "Hello World"가 울립니다.

 

더보기

crontab -u mary -e

23 14 * * * /bin/echo "Hello World" (:wq)

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.

5. /etc/fstab 문서를 /var/TMP 디렉토리에 복사합니다. 다음 요구 사항에 따라 이 문서의 사용 권한을 구성합니다.
▷ 이 문서의 소유자는 루트여야 합니다.
▷ 이 문서는 루트 그룹에 속합니다.
● 사용자 mary는 이 문서에 대한 읽기 및 쓰기 권한을 가집니다.
● 사용자 앨리스는 이 문서에 대한 읽기 및 실행 권한을 가집니다.
▷ 사용자 bob 생성, setuid는 1000입니다. Bob은 이 문서에 대한 읽기 및 쓰기 권한을 가지고 있습니다.
✓ 모든 사용자는 시스템에서 이 문서에 대한 읽기 권한을 가집니다.

 

더보기

cp /etc/fstab /var/tmp

chmod root:root /var/tmp/fstab

setfacl -m u:mary:rw- /var/tmp/fstab

setfacl -m u:alice:r-x /var/tmp/fstab

useradd -u 1000 bob

setfacl -m u:bob:rw- /var/tmp/fstab

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.

6. 웹 서비스를 구성하고 http://instructor.example.com/pub/serverX.html에서 다운로드하십시오. 시스템을 재부팅한 후에도 서비스가 계속 실행 중이어야 합니다.

 

더보기

yum -y install httpd

systemctl enable --now httpd

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

cp serverX.html /var/www/html

systemctl restart httpd

firewall-cmd --permanet --add-service=http

firewall-cmd --reload

 

7. SELinux must be running in the Enforcing mode.

7. SELinux가 적용 모드에서 실행 중이어야 합니다.

 

더보기

vi /etc/selinux/config

SELINUX=enforcing (:wq)

reboot

 

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.

8. 다음 사용자, 그룹 및 그룹 구성원을 생성합니다.
adminuser라는 그룹입니다.
보조 그룹으로 admin 사용자에게 속한 사용자 나타샤 보조 그룹으로 admin 사용자에게 속한 사용자 해리.
시스템의 대화형 셸에 액세스할 수 없고 관리자, 나타샤, 해리 및 사라의 멤버가 아닌 사용자 사라에게는 모두 Redhat 암호가 있어야 합니다.

 

더보기

groupadd adminuser

useradd natasha -g adminuser -p Redhat

useradd harry -g adminuser -p Redhat

usermod -s /sbin/nologin natasha (?)

?

 

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

9. 사용자 나타샤의 cronjob을 14:23에 /bin/echohiya로 설정합니다.

 

더보기

crontab -u natasha -e

23 14 * * * /bin/echo "hiya"

systemctl restart crond

 

-아직 부족하다 돌할우밤 좀 더 분발하자

'IT_공부 > Linux' 카테고리의 다른 글

/Linux/RHCSA/연습문제 1  (0) 2021.07.06
/Linux/RHCSA/11일차(예제 풀기)  (0) 2021.07.04
/Linux/RHCSA/10일차(예제 풀기)  (0) 2021.07.03
/Linux/RHCSA/9일차(예제 풀기)  (0) 2021.07.03
/Linux/RHCSA/8일차(예제 풀기)  (0) 2021.07.02

>