RedHat EX200 Exam Practice Questions (P. 2)
- Full Access (111 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #6
SIMULATION -
Find the rows that contain abcde from file /etc/testfile, and write it to the file/tmp/testfile, and the sequence is requested as the same as /etc/testfile.
Find the rows that contain abcde from file /etc/testfile, and write it to the file/tmp/testfile, and the sequence is requested as the same as /etc/testfile.
Correct Answer:
See explanation below.
# cat /etc/testfile | while read line;
do
echo $line | grep abcde | tee -a /tmp/testfile
done
OR -
grep `abcde' /etc/testfile > /tmp/testfile
See explanation below.
# cat /etc/testfile | while read line;
do
echo $line | grep abcde | tee -a /tmp/testfile
done
OR -
grep `abcde' /etc/testfile > /tmp/testfile
send
light_mode
delete
Question #7
SIMULATION -
Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.
Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.
Correct Answer:
See explanation below.
# fdisk /dev/sda
p
(check Partition table)
n
(create new partition: press e to create extended partition, press p to create the main partition, and the extended partition is further divided into logical partitions)
Enter -
+2G
t
l
W -
partx -a /dev/sda
partprobe
mkswap /dev/sda8
Copy UUID -
swapon -a
vim /etc/fstab
UUID=XXXXX swap swap defaults 0 0
(swapon -s)
See explanation below.
# fdisk /dev/sda
p
(check Partition table)
n
(create new partition: press e to create extended partition, press p to create the main partition, and the extended partition is further divided into logical partitions)
Enter -
+2G
t
l
W -
partx -a /dev/sda
partprobe
mkswap /dev/sda8
Copy UUID -
swapon -a
vim /etc/fstab
UUID=XXXXX swap swap defaults 0 0
(swapon -s)
send
light_mode
delete
Question #8
SIMULATION -
Create a user named alex, and the user id should be 1234, and the password should be alex111.
Create a user named alex, and the user id should be 1234, and the password should be alex111.
Correct Answer:
See explanation below.
# useradd -u 1234 alex
# passwd alex
alex111
alex111
OR -
echo alex111|passwd -stdin alex
See explanation below.
# useradd -u 1234 alex
# passwd alex
alex111
alex111
OR -
echo alex111|passwd -stdin alex

To correctly answer the simulation question, the process involves multiple steps to ensure accuracies such as setting the user ID and the password separately since the useradd command alone won't set a user password directly. First, you should create the user by specifying the UID directly, 'useradd -u 1234 alex', then set the password in a subsequent step using the 'passwd alex' command. This approach allows you to meet the question's requirements correctly and ensures that all parameters are correctly applied, verified using commands like 'id alex'.
send
light_mode
delete
Question #9
SIMULATION -
Install a FTP server, and request to anonymous download from /var/ftp/pub catalog. (it needs you to configure yum direct to the already existing file server.)
Install a FTP server, and request to anonymous download from /var/ftp/pub catalog. (it needs you to configure yum direct to the already existing file server.)
Correct Answer:
See explanation below.
# cd /etc/yum.repos.d
# vim local.repo
[local]
name=local.repo
baseurl=file:///mnt
enabled=1
gpgcheck=0
# yum makecache
# yum install -y vsftpd
# service vsftpd restart
# chkconfig vsftpd on
# chkconfig --list vsftpd
# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
See explanation below.
# cd /etc/yum.repos.d
# vim local.repo
[local]
name=local.repo
baseurl=file:///mnt
enabled=1
gpgcheck=0
# yum makecache
# yum install -y vsftpd
# service vsftpd restart
# chkconfig vsftpd on
# chkconfig --list vsftpd
# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
send
light_mode
delete
Question #10
SIMULATION -
Configure a HTTP server, which can be accessed through
http://station.domain40.example.com.
Please download the released page from http://ip/dir/example.html.
Configure a HTTP server, which can be accessed through
http://station.domain40.example.com.
Please download the released page from http://ip/dir/example.html.
Correct Answer:
See explanation below.
# yum install -y httpd
# chkconfig httpd on
# cd /var/www/html
# wget http://ip/dir/example.html
# cp example.com index.html
# vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.254:80
<VirtualHost 192.168.0.254:80>
DocumentRoot /var/www/html/
ServerName station.domain40.example.com
</VirtualHost>
See explanation below.
# yum install -y httpd
# chkconfig httpd on
# cd /var/www/html
# wget http://ip/dir/example.html
# cp example.com index.html
# vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.254:80
<VirtualHost 192.168.0.254:80>
DocumentRoot /var/www/html/
ServerName station.domain40.example.com
</VirtualHost>
send
light_mode
delete
All Pages