ntp服务器器以及邮件服务器

1、搭建时间服务器,客户端可在每天早晨的9:00整从ntp服务器更新自己的时间。

服务器端:rhel8.2版本(192.168.220.128)

  • 安装chrony包

ntp服务器器以及邮件服务器

  • 编辑/etc/chrony.conf文件

ntp服务器器以及邮件服务器

  • 重启Systemctl restart chronyd

ntp服务器器以及邮件服务器

  • 列出当前我们的NTP与相关的上层NTP的状态

ntp服务器器以及邮件服务器

客户端:rhel7(192.168.220.129)

  • 安装ntp包

ntp服务器器以及邮件服务器

  • 修改/etc/ntp.conf文件

ntp服务器器以及邮件服务器

  • 重启ntp服务

ntp服务器器以及邮件服务器

  • 更新时间

ntp服务器器以及邮件服务器

  •   使用计划任务自动更新客户端的时间,编辑/etc/crontab文件

ntp服务器器以及邮件服务器

 

2、搭建邮件服务器,使用[email protected][email protected]用户发一封邮件,内容为biechile。

①关闭防火墙和selinux:

②安装postfix包

ntp服务器器以及邮件服务器

③编辑/etc/postfix/main.cf

myhostname = mail.ceshi.com

mydomain = ceshi.com

myorigin = $mydomain

inet_interfaces = all

inet_protocols = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

mynetworks = 192.168.220.0/24, 127.0.0.0/8

relay_domains = $mydestination

  • 重启服务:systemctl restart postfix
  • 安装dovecot包

ntp服务器器以及邮件服务器

  • 配置/etc/dovecot/dovecot.conf文件

protocols = imap pop3 lmtp submission

login_trusted_networks = 192.168.220.0/24

配置/etc/dovecot/conf.d/10-mail.conf文件

mail_location = mbox:~/mail:INBOX=/var/mail/%u

  • 安装cyrus-sasl*包

ntp服务器器以及邮件服务器

  • 配置/etc/postfix/main.cf文件

ntp服务器器以及邮件服务器

  • 重启服务

ntp服务器器以及邮件服务器

创建用户:

ntp服务器器以及邮件服务器

ntp服务器器以及邮件服务器

测试结果:

ntp服务器器以及邮件服务器