EX200 無料問題集「RedHat Red Hat Certified System Administrator - RHCSA」
Create the user named eric and deny to interactive login.
正解:
useradd eric
passwd eric
vi /etc/passwd
eric:x:505:505::/home/eric:/sbin/nologin
Which shell or program should start at login time is specified in /etc/passwd file? By default, Redhat Enterprise Linux assigns the /bin/bash shell to the users. To deny the interactive login, you should write /sbin/nologin or /bin/ false instead of login shell.
passwd eric
vi /etc/passwd
eric:x:505:505::/home/eric:/sbin/nologin
Which shell or program should start at login time is specified in /etc/passwd file? By default, Redhat Enterprise Linux assigns the /bin/bash shell to the users. To deny the interactive login, you should write /sbin/nologin or /bin/ false instead of login shell.
Configure a task: plan to run echo hello command at 14:23 every day.
正解:
# which echo
# crontab -e
23 14 * * * /bin/echo hello
# crontab -l (Verify)
# crontab -e
23 14 * * * /bin/echo hello
# crontab -l (Verify)
We are working on /data initially the size is 2GB. The /dev/test0/lvtestvolume is mount on /dat a. Now you required more space on /data but you already added all disks belong to physical volume. You saw that you have unallocated space around 5 GB on your harddisk. Increase the size of lvtestvolume by 5GB.
正解:
Create a partition having size 5 GB and change the syste id '8e'.
use partprobe command
pvcreate /dev/hda9 Suppose your partition number is hda9.
vgextend test0 /dev/hda9 vgextend command add the physical disk on volume group.
lvextend -L+5120M /dev/test0/lvtestvolume
verify using lvdisplay /dev/test0/lvtestvolume.
use partprobe command
pvcreate /dev/hda9 Suppose your partition number is hda9.
vgextend test0 /dev/hda9 vgextend command add the physical disk on volume group.
lvextend -L+5120M /dev/test0/lvtestvolume
verify using lvdisplay /dev/test0/lvtestvolume.
Find all lines in the file /usr/share/dict/words that contain the string seismic. Put a copy of all these lines in their original order in the file /root/wordlist. /root/wordlist should contain no empty lines and all lines must be exact copies of the original lines in /usr/share/dict/words.
正解:
grep seismic /usr/share/dict/words> /root/wordlist
You have a domain named www.rhce.com associated IP address is 192.100.0.2. Configure the Apache web server by implementing the SSL for encryption communication.
正解:
vi /etc/httpd/conf.d/ssl.conf <VirtualHost 192.100.0.2> ServerName www.rhce.com DocumentRoot /var/www/rhce DirectoryIndex index.html index.htm ServerAdmin [email protected] SSLEngine on SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key </VirtualHost> cd /etc/httpd/conf
3 make testcert
Create the directory and index page on specified path. (Index page can download from ftp://server1.example.com at exam time) service httpd start|restart chkconfig httpd on Apache can provide encrypted communications using SSL (Secure Socket Layer). To make use of encrypted communication, a client must request to https protocol, which is uses port 443. For HTTPS protocol required the certificate file and key file.
3 make testcert
Create the directory and index page on specified path. (Index page can download from ftp://server1.example.com at exam time) service httpd start|restart chkconfig httpd on Apache can provide encrypted communications using SSL (Secure Socket Layer). To make use of encrypted communication, a client must request to https protocol, which is uses port 443. For HTTPS protocol required the certificate file and key file.
Create User Accounts
Create the following user accounts, ensuring the checkboxes are enabled:
- Group named sysmgrs
- User natasha, belonging to the sysmgrs group as a secondary group
- User harry, belonging to the sysmgrs group as a secondary group
- User sarah, with no access to interactive shell on the system and not a member of sysmgrs
- Passwords for natasha, harry, and sarah should all be "flectrag".
Create the following user accounts, ensuring the checkboxes are enabled:
- Group named sysmgrs
- User natasha, belonging to the sysmgrs group as a secondary group
- User harry, belonging to the sysmgrs group as a secondary group
- User sarah, with no access to interactive shell on the system and not a member of sysmgrs
- Passwords for natasha, harry, and sarah should all be "flectrag".
正解:
[root@node1 ~]# groupadd sysmgrs
[root@node1 ~]# useradd -G sysmgrs natasha
[root@node1 ~]# useradd -G sysmgrs harry
[root@node1 ~]# useradd -s /bin/false sarah
[root@node1 ~]# echo tianyun |passwd --stdin natasha
[root@node1 ~]# echo tianyun |passwd --stdin harry
[root@node1 ~]# echo tianyun |passwd --stdin sarah
[root@node1 ~]# useradd -G sysmgrs natasha
[root@node1 ~]# useradd -G sysmgrs harry
[root@node1 ~]# useradd -s /bin/false sarah
[root@node1 ~]# echo tianyun |passwd --stdin natasha
[root@node1 ~]# echo tianyun |passwd --stdin harry
[root@node1 ~]# echo tianyun |passwd --stdin sarah
Download the document from ftp://instructor.example.com/pub/testfile, find all lines containing [abcde] and redirect to /MNT/answer document, then rearrange the order according the original content.
正解:
Download the file to /tmp first
grep [abcde] /tmp/testfile > /mnt/answer
grep [abcde] /tmp/testfile > /mnt/answer
There is a local logical volumes in your system, named with shrink and belong to VGSRV volume group, mount to the /shrink directory. The definition of size is 320 MB.
Requirement:
Reduce the logical volume to 220 MB without any loss of dat
a. The size is allowed between 200-260 MB after reducing.
Requirement:
Reduce the logical volume to 220 MB without any loss of dat
a. The size is allowed between 200-260 MB after reducing.
正解:
cd;umount /shrink
e2fsck -f /dev/mapper/vgsrv-shrink
resize2fs /dev/mapper/vgsrv-shrink 220M
lvreduce -L 220M /dev/mapper/vgsrv-shrink
mount -a
e2fsck -f /dev/mapper/vgsrv-shrink
resize2fs /dev/mapper/vgsrv-shrink 220M
lvreduce -L 220M /dev/mapper/vgsrv-shrink
mount -a
Binding to an external validation server.
System server.domain11.example.com provides a LDAP validation service, your system should bind to this service as required:
Base DN of validation service is dc=example,dc=com
LDAP is used for providing account information and validation information Connecting and using the certification of http://server.domain11.example.com/pub/EXAMPLE-CA-CERT to encrypt After the correct configuration, ldapuser1 can log into your system, it does not have HOME directory until you finish autofs questions, ldapuser1 password is password.
System server.domain11.example.com provides a LDAP validation service, your system should bind to this service as required:
Base DN of validation service is dc=example,dc=com
LDAP is used for providing account information and validation information Connecting and using the certification of http://server.domain11.example.com/pub/EXAMPLE-CA-CERT to encrypt After the correct configuration, ldapuser1 can log into your system, it does not have HOME directory until you finish autofs questions, ldapuser1 password is password.
正解:
yum -y install sssd authconfig-gtk krb5-workstation authconfig-gtk // open the graphical interface Modify user account database to ldap, fill up DN and LDAP SERVER as questions required, use TLS to encrypt connections making tick, write http://server.domain11.example.com/pub/EXAMPLE-CA-CERT to download ca, authentication method choose ldap password.
You can test if the ldapuser is added by the following command:
Id ldapuser1
Note: user password doesn't not need to set
You can test if the ldapuser is added by the following command:
Id ldapuser1
Note: user password doesn't not need to set
Make a swap partition having 100MB. Make Automatically Usable at System Boot Time.
正解:
Use fdisk /dev/hda ->To create new partition.
Type n-> For New partition
It will ask for Logical or Primary Partitions. Press l for logical.
It will ask for the Starting Cylinder: Use the Default by pressing Enter Key.
Type the Size: +100M ->You can Specify either Last cylinder of Size here.
Press P to verify the partitions lists and remember the partitions name. Default System ID is 83 that means Linux Native.
Type t to change the System ID of partition.
Type Partition Number
Type 82 that means Linux Swap.
Press w to write on partitions table.
Either Reboot or use partprobe command.
mkswap /dev/hda? ->To create Swap File system on partition.
swapon /dev/hda? ->To enable the Swap space from partition.
free -m ->Verify Either Swap is enabled or not.
vi /etc/fstab/dev/hda? swap swap defaults 0 0
Reboot the System and verify that swap is automatically enabled or not.
Type n-> For New partition
It will ask for Logical or Primary Partitions. Press l for logical.
It will ask for the Starting Cylinder: Use the Default by pressing Enter Key.
Type the Size: +100M ->You can Specify either Last cylinder of Size here.
Press P to verify the partitions lists and remember the partitions name. Default System ID is 83 that means Linux Native.
Type t to change the System ID of partition.
Type Partition Number
Type 82 that means Linux Swap.
Press w to write on partitions table.
Either Reboot or use partprobe command.
mkswap /dev/hda? ->To create Swap File system on partition.
swapon /dev/hda? ->To enable the Swap space from partition.
free -m ->Verify Either Swap is enabled or not.
vi /etc/fstab/dev/hda? swap swap defaults 0 0
Reboot the System and verify that swap is automatically enabled or not.