Learning Linux the third day 2020/3/21 (reset)

1. Create a directory ceshi under the root, create a user directory under the test directory, copy the /etc/passwd and /etc/shadow files to the /ceshi/user directory, and create a hard link file for the /ceshi/user file For passwd.bak, create a soft link sh.link to the /ceshi/user/shadow file

Create the ceshi directory file in the root directory and the user directory file in the ceshi directory
Insert picture description here
Copy the /etc/passwd file and the /etc/shadow file to the /ceshi/user directory
CP——copy
cp file name 1 (space) file name 2 ( Larger space) file name 3, copy the contents of file name 1 and file name 2 to file name 3,
Insert picture description here
create hard link file passwd.bak and soft link file sh.link
Insert picture description here
Insert picture description here
check, the creation is successful
Insert picture description here

2. Copy the /etc/ssh/sshd_config file to the /ceshi directory and rename it to sshd

Insert picture description here

3. Find the files with the file name passwd in the root directory and write the file names of these files into the passwd.txt file

find (search) / (under the root directory) -name (named) passwd (file) | tee (write)/passwd.txt

Insert picture description here
Check, write successfully
Insert picture description here

4. Create a test directory in the root user's home directory, and move /ceshi/sshd and /ceshi/user/passwd.bak to the test directory

Create test under root and Insert picture description here
move /ceshi/sshd and /ceshi/user/passwd.bak to the test directoryInsert picture description here
Insert picture description here

5. Pack the user directory and /root/test/sshd file in the ceshi directory and compress it into the test directory with the gzip program, and download the compressed file to the Windows client

Make a compressed package (named yasuobao), sz /root/test/ compressed package -> download to the Windows client

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description heredownload successful

6. Decompress the compressed file in 5 to the ordinary user's home directory, find the content of the line starting with b or c from the decompressed file and write its content into the file file under the ordinary user's home directory

Unzip the compressed file to the home directory of the common user.
Insert picture description here
Find the content of the line starting with b or c and
Insert picture description here
write it into the file file in the home directory of the common user. Check and write successfully
Insert picture description here

Guess you like

Origin blog.csdn.net/MHguitar/article/details/105102528