1、指定在每天凌晨4:00将该时间点之前的系统日志信息(/var/log/messages )备份到目录下/backup,备份后日志文件名显示格式logfileYY-MM-DD-HH-MM
[root@localhost ~]# mkdir /backup
[root@localhost ~]# vim /etc/crontab
0 4 * * * cp /var/log/messages /backup/logfile`date +\%F#%R`
2、配置ssh免密登陆:客户端主机通过redhat用户基于秘钥验证方式进行远程连接服务器的root用户。
服务器ip:192.168.238.130
客户端ip:192.168.239.131
客户端://创建公钥并将公钥发到服务器
ssh-keygen -t RSA
ssh-copy-id -i /root/.ssh/id_rsa.pub 192.168.239.130
服务器://检查是否收到公钥
ll .ssh/
total 4
-rw-------. 1 root root 580 Nov 25 10:23 authorized_keys
客户端://ssh访问服务器
ssh root@192.168.239.130
ifconfig
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.239.130 netmask 255.255.255.0 broadcast 192.168.239.255 ````
3、搭建一个web网站,网站显示hello world内容
dnf install nginx -y #下载nginx提供的http服务
systemctl stop firewalld.service //关闭防火墙
setenforce 0
systemctl restart nginx.service
echo hello world > /usr/share/nginx/html/index.html
