File:/home/kiosk/desktop/11.2 Page 1 of 1
Complete the following actions in the desktop virtual machine
1. Create a new user and meet the following conditions
1) Asasin, uid=2000
Useradd-u Asasin
2) Sareo, uid=2001
Useradd-u 2001 Sareo
3) All two users belong to the Deho group
Groupadd Deho
Usermod-ag Deho Asasin
Usermod-ag Deho Sareo
4) These two users have a password of westos0oll
passwd Asasin Westos0oll
passwd Saero Westos0oll
5) New User Taromati
Useradd Taromati
6) This user is a system user with no interactive shell
Usermod-s/bin/bash Admin
2. Create a new file/public and meet the following conditions
Mkdir/public
1) All users can create files in this directory
chmod 755/public
2) All files created in this directory, except for Sareo users, are automatically attributed to the Deho group
chmod 2755/public
3) Sareo cannot do anything to create all new files in this directory
Setfacl-m d:u:sareo:0/public
4) Anyone can only delete files belonging to their own in the secondary directory
chmod 1777/public
File:/home/kiosk/desktop/rh124-exam1 Page 1 of 2
Exam Information:
IPADDR:172.25.X.100 (x here refers to your workstation number)
netmask:255.255.255.0
gateway:172.25.x.254
dns:172.25.254.254
The Yum source address is: ftp://172.25.x.250/pub/rhel7.0
1.
Please reset the root user password to Examwestos before taking the exam.
passwd
Examwestos
2.
Change the host name to Station.domainX.example.com (X here refers to your workstation number)
Hostnamectl Set-hostname station.domainX.example.com
3
Create a new group with the name Sysadms, specifying its GID to be 600
Groupadd-g Sysadms
4
New user Tommy, specify UID 2013, configure the user password to Redhat
Useradd-u Tommy
passwd
Redhat
5
New user Jimmy, and disable the user's interactive logon, configure the user password to Redhat
Useradd Jimmy
Usermod-s/sbin/nologin Jimmy
6
Create a new user Natasha,harry and add the two users to the SYSADMS group as the subordinate group and, if necessary, configure the user password to Redhat
Useradd Natasha
Useradd Harry
USERMOD-AG Natasha Sysadms
Usermod-ag Harry Sysadms
7
Create the directory materials in the/home directory, configure the directory to belong to the group SYSADMS, require members of the SYSADMS group to have read and write permissions to the directory,
The files or folders created in the Sysadms directory, and the groups they belong to
Automatically inherit the owning group of SYSADMS
Mkdir/home/materials
chmod 2777/home/materials
Setfacl-m u:sysadms:rw-/home/materials
Setfacl-m d:g:sysadms:rw-/home/materials
8
Copy the/etc/fstab file to the/var/tmp directory and set the following requirements
Cp-r/etc/fstab/var/tmp
So that Harry's users have no permissions on the file
Setfacl-m u:harry:0/var/tmp/fstab
Enable Natasha to have full control of the file
Setfacl-m U:natasha:rwx/var/tmp/fstab
Configuration file belongs to user root
Setfacl-m U:root:7/var/tmp/fstab
Configuration file belongs to group root
Setfacl-m U:root:7/var/tmp/fstab
All other users have read access to the file
Setfacl-m o::-r-/var/tmp/fstab
All other users do not have permission to execute files
Setfacl-m o::/var/tmp/fstab
9
Set up an NTP client to synchronize time with 172.25.x.254
Vim/etc/chrony.cof
Server 172.25.x.254 Iburst
10
Locate the files owned by the user group mail and place them in the/root/findresults directory
Find/-group Mail &>/root/findresults
11
File:/home/kiosk/desktop/rh124-exam1 Page 2 of 2
Find all lines containing ich in the file/usr/share/mime/packages/freedesktop.org.xml, will find
Cat/usr/share/mime/packages/freedesktop.org.xml | grep "Ich" &>/root/lines
The lines are copied to/root/lines in sequence.
File, the/root/lines file does not contain spaces, and the contents of the line are the exact/usr/share/mime/packages/freedesktop.org.xml original line of the source file
Copy
%s/^\ *//g/* Remove all spaces that begin with spaces in the file
%s/\t//g/* Remove the TAB key from the beginning of the file
The first book comes with practice, and the test exercises