RHCE 無料問題集「RedHat Red Hat Certified Engineer - RHCE」
CORRECT TEXT
Add 3 users: harry, natasha, tom.
The requirements: The Additional group of the two users:
harry, Natasha is the admin group.
The user: tom's login shell should be non-interactive.
Add 3 users: harry, natasha, tom.
The requirements: The Additional group of the two users:
harry, Natasha is the admin group.
The user: tom's login shell should be non-interactive.
正解:
#useradd-Gadminharry
#useradd-Gadminnatasha
#useradd-s/sbin/nologintom
#idharry;idNatasha(Showadditionalgroup)
#cat/etc/passwd(Showtheloginshell)OR
#system-config-users
#useradd-Gadminnatasha
#useradd-s/sbin/nologintom
#idharry;idNatasha(Showadditionalgroup)
#cat/etc/passwd(Showtheloginshell)OR
#system-config-users
CORRECT TEXT
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.
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<VirtualHost192.100.0.2>ServerNamewww.rhce.comDocumentRoot/var/www/rhceDirectoryIndexindex.htmlindex.htmServerAdminwebmaster@rhce.comSSLEngineonSSLCertificateFile/etc/httpd/conf/ssl.crt/server.crtSSLCertificateKeyFile/etc/httpd/conf/ssl.key/server.key</VirtualHost>
cd/etc/httpd/conf3maketestcert
Createthedirectoryandindexpageonspecifiedpath.(Indexpagecandownloadfromftp://server1.example.comatexamtime)
servicehttpdstart|restart
chkconfighttpdonApachecanprovideencryptedcommunicationsusingSSL(SecureSocketLayer).Tomakeuseofencryptedcommunicationaclientmustrequesttohttpsprotocolwhichisusesport443.ForHTTPSprotocolrequiredthecertificatefileandkeyfile.
cd/etc/httpd/conf3maketestcert
Createthedirectoryandindexpageonspecifiedpath.(Indexpagecandownloadfromftp://server1.example.comatexamtime)
servicehttpdstart|restart
chkconfighttpdonApachecanprovideencryptedcommunicationsusingSSL(SecureSocketLayer).Tomakeuseofencryptedcommunicationaclientmustrequesttohttpsprotocolwhichisusesport443.ForHTTPSprotocolrequiredthecertificatefileandkeyfile.
CORRECT TEXT
Set cronjob for user natasha to do /bin/echo hiya at 14:23.
Set cronjob for user natasha to do /bin/echo hiya at 14:23.
正解:
#crontab-e-unatasha2314***/bin/echohiyawq!
CORRECT TEXT
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.
正解:
#fdisk/dev/sdap(checkPartitiontable)n(createnewpartition:pressetocreateextendedpartitionpressptocreatethemainpartitionandtheextendedpartitionisfurtherdividedintologicalpartitions)Enter+2GtlWpartx-a/dev/sdapartprobemkswap/dev/sda8CopyUUIDswapon-avim/etc/fstabUUID=XXXXXswapswapdefaults00(swapon-s)
CORRECT TEXT
Create the user named eric and deny to interactive login.
Create the user named eric and deny to interactive login.
正解:
useradderic
passwderic
vi/etc/passwd
eric:x:505:505::/home/eric:/sbin/nologinWhichshellorprogramshouldstartatlogintimeisspecifiedin/etc/passwdfile?BydefaultRedhatEnterpriseLinuxassignsthe/bin/bashshelltotheusers.Todenytheinteractiveloginyoushouldwrite/sbin/nologinor/bin/falseinsteadofloginshell.
passwderic
vi/etc/passwd
eric:x:505:505::/home/eric:/sbin/nologinWhichshellorprogramshouldstartatlogintimeisspecifiedin/etc/passwdfile?BydefaultRedhatEnterpriseLinuxassignsthe/bin/bashshelltotheusers.Todenytheinteractiveloginyoushouldwrite/sbin/nologinor/bin/falseinsteadofloginshell.
CORRECT TEXT
Create a backup
Create a backup file named /root/backup.tar.bz2, contains the content of /usr/local, tar must use bzip2 to compress.
Create a backup
Create a backup file named /root/backup.tar.bz2, contains the content of /usr/local, tar must use bzip2 to compress.
正解:
cd/usr/localtar-jcvf/root/backup.tar.bz2mkdir/testtar-jxvf/root/backup.tar.bz2-C/test//Decompressiontocheckthecontentisthesameasthe/usr/locaafterIfthequestionsrequiretousegziptocompress.change-jto-z.
CORRECT TEXT
Create a catalog under /home named admins. Its respective group is requested to be the admin group. The group users could read and write, while other users are not allowed to access it. The files created by users from the same group should also be the admin group.
Create a catalog under /home named admins. Its respective group is requested to be the admin group. The group users could read and write, while other users are not allowed to access it. The files created by users from the same group should also be the admin group.
正解:
#cd/home/
#mkdiradmins/
#chown.adminadmins/
#chmod770admins/
#chmodg+sadmins/
#mkdiradmins/
#chown.adminadmins/
#chmod770admins/
#chmodg+sadmins/
CORRECT TEXT
Configure the permissions of /var/tmp/fstab
Copy the file /etc/fstab to /var/tmp/fstab. Configure the permissions of /var/tmp/fstab so that:
the file /var/tmp/fstab is owned by the root user.
the file /var/tmp/fstab belongs to the group root.
the file /var/tmp/fstab should not be executable by anyone.
the user natasha is able to read and write /var/tmp/fstab.
the user harry can neither write nor read /var/tmp/fstab.
all other users (current or future) have the ability to read /var/tmp/fstab.
Configure the permissions of /var/tmp/fstab
Copy the file /etc/fstab to /var/tmp/fstab. Configure the permissions of /var/tmp/fstab so that:
the file /var/tmp/fstab is owned by the root user.
the file /var/tmp/fstab belongs to the group root.
the file /var/tmp/fstab should not be executable by anyone.
the user natasha is able to read and write /var/tmp/fstab.
the user harry can neither write nor read /var/tmp/fstab.
all other users (current or future) have the ability to read /var/tmp/fstab.
正解:
cp-a/etc/fstab/var/tmp
cd/var/tmp
ls-l
getfacl/var/tmp/fstab
chmodugo-x/var/tmp/fstab[Noneedtodothistherewon'tbeexecutepermissionforthefilebydefault]
#setfacl-mu:natasha:rw/var/tmp/fstab
#setfacl-mu:harry:0/var/tmp/fstab(zero)[Readpermissionwillbethereforalltheusersbydefault.Checkitusingls-l/var/tmp/fstab]Verifyby[ls-la/var/tmp/fstab]
cd/var/tmp
ls-l
getfacl/var/tmp/fstab
chmodugo-x/var/tmp/fstab[Noneedtodothistherewon'tbeexecutepermissionforthefilebydefault]
#setfacl-mu:natasha:rw/var/tmp/fstab
#setfacl-mu:harry:0/var/tmp/fstab(zero)[Readpermissionwillbethereforalltheusersbydefault.Checkitusingls-l/var/tmp/fstab]Verifyby[ls-la/var/tmp/fstab]
CORRECT TEXT
Make on data that only the user owner and group owner member can fully access.
Make on data that only the user owner and group owner member can fully access.
正解:
chmod770/data
Verifyusing:ls-ld/dataPreviewshouldbelike:drwxrwx---2rootsysadmin4096Mar1618:08/dataTochangethepermissionondirectoryweusethechmodcommand.Accordingtothequestionthatonlytheowneruser(root)andgroupmember(sysadmin)canfullyaccessthedirectoryso:chmod770/data
Verifyusing:ls-ld/dataPreviewshouldbelike:drwxrwx---2rootsysadmin4096Mar1618:08/dataTochangethepermissionondirectoryweusethechmodcommand.Accordingtothequestionthatonlytheowneruser(root)andgroupmember(sysadmin)canfullyaccessthedirectoryso:chmod770/data
CORRECT TEXT
Create one partitions having size 100MB and mount it on data.
Create one partitions having size 100MB and mount it on data.
正解:
1.Usefdisk/dev/hdatocreatenewpartition.2.TypenForNewpartitions.3.ItwillaskforLogicalorPrimaryPartitions.Presslforlogical.4.ItwillaskfortheStartingCylinder:UsetheDefaultbypressingEnterKey.5.TypetheSize:+100MyoucanspecifyeitherLastcylinderofsizehere.6.PressPtoverifythepartitionslistsandrememberthepartitionsname.7.Presswtowriteonpartitionstable.8.EitherRebootorusepartprobecommand.9.Usemkfs-text3/dev/hda?ORmke2fs-j/dev/hda?Tocreateext3filesystem.vi/etc/fstabWrite:/dev/hda?/dataext3defaults12VerifybymountingoncurrentSessionsalso:mount/dev/hda?/data