EX200試験無料問題集「RedHat Red Hat Certified System Administrator - RHCSA 認定」
Some users home directory is shared from your system. Using showmount -e localhost command, the shared directory is not shown. Make access the shared users home directory.
正解:
Verify the File whether Shared or not ? : cat /etc/exports
Start the nfs service: service nfs start
Start the portmap service: service portmap start
Make automatically start the nfs service on next reboot: chkconfig nfs on Make automatically start the portmap service on next reboot: chkconfig portmap on Verify either sharing or not: showmount -e localhost Check that default firewall is running on system?
If running flush the iptables using iptables -F and stop the iptables service.
Start the nfs service: service nfs start
Start the portmap service: service portmap start
Make automatically start the nfs service on next reboot: chkconfig nfs on Make automatically start the portmap service on next reboot: chkconfig portmap on Verify either sharing or not: showmount -e localhost Check that default firewall is running on system?
If running flush the iptables using iptables -F and stop the iptables service.
Please open the ip_forward, and take effect permanently.
正解:
vim /etc/sysctl.conf net.ipv4.ip_forward = 1
sysctl -w (takes effect immediately)
If no "sysctl.conf" option, use these commands:
sysctl -a |grep net.ipv4
sysctl -P net.ipv4.ip_forward = 1
sysctl -w
sysctl -w (takes effect immediately)
If no "sysctl.conf" option, use these commands:
sysctl -a |grep net.ipv4
sysctl -P net.ipv4.ip_forward = 1
sysctl -w
Add Swap Partition
Add an additional swap partition of 512 MiB to your system. The swap partition should be automatically mounted at system startup. Do not delete or modify any existing swap partitions on the system.
Add an additional swap partition of 512 MiB to your system. The swap partition should be automatically mounted at system startup. Do not delete or modify any existing swap partitions on the system.
正解:
[root@node2 ~]# lsblk
[root@node2 ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): n
Partition number (3-128, default 3):
First sector (1476608-10485726, default 1476608):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1476608-10485726, default 10485726): +512M
Created a new partition 3 of type 'Linux filesystem' and of size 512 MiB.
Command (m for help): w
The partition table has been altered.
Syncing disks.
[root@node2 ~]# mkswap /dev/vdb3
[root@node2 ~]# vim /etc/fstab
/dev/vdb3 swap swap defaults 0 0
[root@node2 ~]# swapon -a
[root@node2 ~]# swapon
NAME TYPE SIZE USED PRIO
/dev/vdb2 partition 243M 0B -2
/dev/vdb3 partition 512M 0B -3
[root@node2 ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): n
Partition number (3-128, default 3):
First sector (1476608-10485726, default 1476608):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1476608-10485726, default 10485726): +512M
Created a new partition 3 of type 'Linux filesystem' and of size 512 MiB.
Command (m for help): w
The partition table has been altered.
Syncing disks.
[root@node2 ~]# mkswap /dev/vdb3
[root@node2 ~]# vim /etc/fstab
/dev/vdb3 swap swap defaults 0 0
[root@node2 ~]# swapon -a
[root@node2 ~]# swapon
NAME TYPE SIZE USED PRIO
/dev/vdb2 partition 243M 0B -2
/dev/vdb3 partition 512M 0B -3
Find Files
Find all files belonging to the user "jacques" and move them to the directory /root/findfiles under the root directory.
Find all files belonging to the user "jacques" and move them to the directory /root/findfiles under the root directory.
正解:
[root@node1 ~]# mkdir /root/findfiles
[root@node1 ~]# find / -user jacques
[root@node1 ~]# find / -user jacques -exec cp -a {} /root/findfiles \;
# Verification
[root@node1 ~]# ll /root/findfiles/
[root@node1 ~]# find / -user jacques
[root@node1 ~]# find / -user jacques -exec cp -a {} /root/findfiles \;
# Verification
[root@node1 ~]# ll /root/findfiles/
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)
One Domain RHCE is configured in your lab, your domain server is server1.example.com. nisuser2001, nisuser2002, nisuser2003 user are created on your server 192.168.0.254:/rhome/stationx/nisuser2001. Make sure that when NIS user login in your system automatically mount the home directory. Home directory is separately shared on server /rhome/stationx/ where x is your Station number.
正解:
use the authconfig --nisserver=<NIS SERVER> --nisdomain=<NIS DOMAIN> -- update Example: authconfig --niserver=192.168.0.254 --nisdomain=RHCE --update or system-config-authentication Click on Enable NIS Type the NIS Domain: RHCE Type Server 192.168.0.254 then click on next and ok You will get a ok message.
Create a Directory /rhome/stationx where x is your station number.
vi /etc/auto.master and write at the end of file /rhome/stationx /etc/auto.home --timeout=60 vi /etc/auto.home and write
* -rw,soft,intr 192.168.0.254:/rhome/stationx/&
Note: please specify your station number in the place of x.
Service autofs restart
Login as the nisuser2001 or nisuser2002 on another terminal will be Success. According to question, RHCE domain is already configured. We have to make a client of RHCE domain and automatically mount the home directory on your system. To make a member of domain, we use the authconfig with option or system-config authentication command. There a are lots of authentication server i.e NIS, LDAB, SMB etc. NIS is a RPC related Services, no need to configure the DNS, we should specify the NIS server address.
Here Automount feature is available. When user tried to login, home directory will automatically mount. The automount service used the /etc/auto.master file. On
/etc/auto.master file we specified the mount point the configuration file for mount point.
Create a Directory /rhome/stationx where x is your station number.
vi /etc/auto.master and write at the end of file /rhome/stationx /etc/auto.home --timeout=60 vi /etc/auto.home and write
* -rw,soft,intr 192.168.0.254:/rhome/stationx/&
Note: please specify your station number in the place of x.
Service autofs restart
Login as the nisuser2001 or nisuser2002 on another terminal will be Success. According to question, RHCE domain is already configured. We have to make a client of RHCE domain and automatically mount the home directory on your system. To make a member of domain, we use the authconfig with option or system-config authentication command. There a are lots of authentication server i.e NIS, LDAB, SMB etc. NIS is a RPC related Services, no need to configure the DNS, we should specify the NIS server address.
Here Automount feature is available. When user tried to login, home directory will automatically mount. The automount service used the /etc/auto.master file. On
/etc/auto.master file we specified the mount point the configuration file for mount point.
Locate all the files owned by ira and copy them to the / root/findresults directory.
正解:
# find / -user ira > /root/findresults (if /root/findfiles is a file)
# mkdir -p /root/findresults
# find / -user ira -exec cp -a {} /root/findresults\; [ if /root/findfiles is a directory] ls /root/findresults
# mkdir -p /root/findresults
# find / -user ira -exec cp -a {} /root/findresults\; [ if /root/findfiles is a directory] ls /root/findresults
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.
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
chmod ugo-x /var/tmp/fstab
[ No need to do this, there won't be execute permission for the file by default]
# setfacl -m u:natasha:rw /var/tmp/fstab # setfacl -m u:harry:0 /var/tmp/fstab(zero)
[Read permission will be there for all the users, by default. Check it using ls -l /var/tmp/fstab] Verify by
[ ls -la /var/tmp/fstab]
cd /var/tmp
ls -l
getfacl /var/tmp/fstab
chmod ugo-x /var/tmp/fstab
[ No need to do this, there won't be execute permission for the file by default]
# setfacl -m u:natasha:rw /var/tmp/fstab # setfacl -m u:harry:0 /var/tmp/fstab(zero)
[Read permission will be there for all the users, by default. Check it using ls -l /var/tmp/fstab] Verify by
[ ls -la /var/tmp/fstab]
Download ftp://192.168.0.254/pub/boot.iso to /root, and mounted automatically under /media/cdrom and which take effect automatically at boot-start.
正解:
# cd /root; wget ftp://192.168.0.254/pub/boot.iso
# mkdir -p /media/cdrom
# vim /etc/fstab
/root/boot.iso /media/cdrom iso9660 defaults,loop 0 0
# mount -a
mount [-t vfstype] [-o options] device dir
# mkdir -p /media/cdrom
# vim /etc/fstab
/root/boot.iso /media/cdrom iso9660 defaults,loop 0 0
# mount -a
mount [-t vfstype] [-o options] device dir
Create User Account.
Create the following user, group and group membership:
Adminuser group
User natasha, using adminuser as a sub group
User Harry, also using adminuser as a sub group
User sarah, can not access the SHELL which is interactive in the system, and is not a member of adminuser, natasha,harry,sarah password is redhat.
Create the following user, group and group membership:
Adminuser group
User natasha, using adminuser as a sub group
User Harry, also using adminuser as a sub group
User sarah, can not access the SHELL which is interactive in the system, and is not a member of adminuser, natasha,harry,sarah password is redhat.
正解:
groupadd adminuser
useradd natasha -G adminuser
useradd haryy -G adminuser
useradd sarah -s /sbin/nologin
Passwd user name // to modify password or echo redhat | passwd --stdin user name id natasha // to view user group.
useradd natasha -G adminuser
useradd haryy -G adminuser
useradd sarah -s /sbin/nologin
Passwd user name // to modify password or echo redhat | passwd --stdin user name id natasha // to view user group.