1、搭建时间服务器,客户端可在每天早晨的9:00整从ntp服务器更新自己的时间。
2、搭建邮件服务器,使用wukong@ceshi.com给wuneng@ceshi.com用户发一封邮件,内容为biechile。
一、时间服务器
1.安装chrony包
[root@localhost ~]# yum install -y chrony
2.编辑配置文件
允许客户机访问本台服务器
[root@localhost ~]# vim /etc/chrony.conf
3.重启chronyd服务
[root@localhost ~]# systemctl restart chronyd
查看一下时间
4.在客户端安装chronyd包
我客户端用到的是7的镜像
[root@localhost ~]# yum install -y chrony
5.在客户端安装配置文件
[root@localhost ~]# vi /etc/chrony.conf
重启服务
[root@localhost ~]# systemctl restart chronyd
6.查看时间 ,修改时间,从服务端 同步时间
服务器
[root@localhost ~]# date
2020年 10月 29日 星期四 22:28:42 CST
客户端
[root@localhost ~]# date
Thu Oct 22 01:14:25 EDT 2020
重启服务
[root@localhost ~]# systemctl restart chronyd
查看时间
[root@localhost ~]# date
2020年 10月 29日 星期四 22:30:16 CST
7.服务端写计划任务
设置开机自启动
[root@localhost ~]# systemctl enable chronyd
二、邮件服务器
1.安装postfix包
记得关闭防火墙
[root@localhost ~]# yum install -y postfix
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
2.编辑主配置文件
[root@localhost ~]# vim /etc/postfix/main.cf
3.重启服务
[root@localhost ~]# systemctl restart postfix
4.安装dovecot包
[root@localhost ~]# yum install -y dovecot
5.配置主配置文件
[root@localhost ~]# vim /etc/dovecot/dovecot.conf
设置允许登录的IP段
5.编辑文件 /etc/dovecot/conf.d/10-mail.conf
[root@localhost ~]# vim /etc/dovecot/conf.d/10-mail.conf
6. 服务端开启sasl认证,安装sasl模块的软件包cyrus-sasl
[root@localhost ~]# yum install -y cyrus-sasl
7. 编辑postfix配置文件
[root@localhost ~]# vim /etc/postfix/main.cf
在文件最后添加
8. 重启服务
[root@localhost ~]# systemctl restart postfix
[root@localhost ~]# systemctl restart dovecot
[root@localhost ~]# systemctl restart saslauthd
9. 创建用户wukong和wuneng
[root@localhost ~]# useradd wukong
[root@localhost ~]# useradd wuneng
设置密码
[root@localhost ~]# echo root | passwd --stdin wukong
更改用户 wukong 的密码 。
passwd:所有的身份验证令牌已经成功更新。
[root@localhost ~]# echo root | passwd --stdin wuneng
更改用户 wuneng 的密码 。
passwd:所有的身份验证令牌已经成功更新。
10. 修改权限
[root@localhost ~]# chmod 0600 /var/mail/*