1、指定在每天凌晨4:00将该时间点之前的系统日志信息(/var/log/messages )备份到目录下/backup,备份后日志文件名显示格式logfileYY-MM-DD-HH-MM
操作:
[root@ssh-server ~]# cp /var/log/messages /backup/logfile`date +\%Y-%\m-%\d-%\ H:%\M:%\S`
[root@ssh-server ~]# crontab -e
2、配置ssh免密登陆:客户端主机通过redhat用户基于秘钥验证方式进行远程连接服务器的root用户。
操作:
[root@MPF ~]# ssh-keygen -t rsa
[root@MPF ~]# ssh-copy-id root@服务器地址 #复制该公钥文件到服务端的该目录下
[root@MPF ~]# ssh root@服务端地址
免密连接成功!
3、搭建一个web网站,网站显示hello world内容
[root@ssh-server ~]# systemctl disable firewalld --now #关闭防火墙
[root@ssh-server ~]# setenforce 0 #设置selinux
[root@ssh-server ~]# dnf install nginx -y #安装nginx
[root@ssh-server ~]# systemctl start nginx #开启nginx服务
再浏览器输入本机IP地址:
搭建成功!