Technology Sharing

Cloud Computing Exercises

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Question 1: Every Sunday at 11:59 pm, the /data directory needs to be packaged and compressed into the /mnt directory and named after the time.

#crontab -e
59 23 * * 7 /bin/tar czvf /mnt/`date +%F`-data.tar.gz /data
59 23 * * 7 /bin/tar czvf /mnt/`date +%T`.tar.gz /data

Question 2: Find all tar.gz files in the /application directory of the system and back them up to the /opt directory?

find /application -name'*.tar.gz' -exec cp -r {} /opt ;

Question 3: What is the difference between ssh and telnet?

ssh:对数据加密,数据经过压缩,传输速度快,更安全
telnet:明文传送报文,不加密,传输不安全,传输慢

Question 4: How to determine whether a process such as nginx exists or is started? Please give the command

# ps -ef | grep nginx
systemctl status nginx
netstat -lntp | grep nginx

Question 5: How to prohibit remote login by root user?

vim /etc/ssh/sshd_config +38
PermitRootLogin no

Question 6: The /etc/passwd file requires you to modify the file attributes. You can only view the file content and no other operations can be performed on the file.

chattr +i /etc/passwd

Question 7: First put vim a.txt in the background, then call it to the foreground and enter the content 123 without saving it. Then kill vim after putting it in the background?

# vim a.txt &
# jobs
# fg %工作号
ctrl+z
jobs
# kill -9 %工作号

Question 8: Create a directory called /home/test, with the owner being root and the group being it. Any files created by any user in this directory must inherit the group of the directory?

# mkdir /home/test
# groupadd it
# chown root.it /home/test
# chmod g+s /home/test

Question 9: How do I know whether my machine can access the Internet? What command do I use? What protocol does it use?

ping命令
ICMP协议

Question 10: What is the difference between soft link and hard link?

软链接:可以给目录做链接,硬链接不可以
删除源文件硬链接不受影响,软链接失效
软链接可以跨分区,硬链接不可以