Pages

Wednesday 6 November 2019

Installation and Configure Postfix Service with Mariadb Database. (1/7)

Installation of Postfix with Mysql Database step by step(1/7)


# Configure Static ip address to a server

[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:e0:d3:c5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.2/24 brd 192.168.10.255 scope global dynamic enp0s3
       valid_lft 736sec preferred_lft 736sec
    inet6 fe80::61e1:d548:2e53:232b/64 scope link
       valid_lft forever preferred_lft forever
[root@localhost ~]#


# Change Hostname of the server

[root@localhost ~]# hostnamectl set-hostname master.zmailtech.com
[root@localhost ~]# hostname
mailserver.zmailtech.com
[root@localhost ~]#

[root@localhost ~]# cat /etc/sysconfig/network
# Created by anaconda
HOSTNAME=mailserver.zmailtech.com
[root@localhost ~]#
 


# Set SELinux policy in Permissive mode 



[root@mailserver ~]# setenforce 0
[root@mailserver ~]# getenforce
Permissive

[root@mailserver ~]# vim /etc/selinux/config
[root@mailserver ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@mailserver ~]# 

# Configure self-sign SSL Certificate.

[root@mailserver ~]# cd /etc/pki/tls/certs/

[root@mailserver certs]# make mailserver.example.com.key
umask 77 ; \
/usr/bin/openssl genrsa -aes128 2048 > mailserver.example.com.key
Generating RSA private key, 2048 bit long modulus
...................+++
.............................+++
e is 65537 (0x10001)
Enter pass phrase:
Verifying - Enter pass phrase:

[root@mailserver certs]# openssl rsa -in mailserver.example.com.key -out mailserver.example.com.key
Enter pass phrase for mailserver.example.com.key:
writing RSA key

[root@mailserver certs]# make mailserver.example.com.csr
umask 77 ; \
/usr/bin/openssl req -utf8 -new -key mailserver.example.com.key -out mailserver.example.com.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:IN
State or Province Name (full name) []:Gujarat
Locality Name (eg, city) [Default City]:Ahmedabad
Organization Name (eg, company) [Default Company Ltd]:example
Organizational Unit Name (eg, section) []:mailserver
Common Name (eg, your name or your server's hostname) []:
Email Address []:testuser@example.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:redhat
An optional company name []:

[root@mailserver certs]# openssl x509 -in mailserver.example.com.csr -out mailserver.example.com.crt -req -signkey mailserver.example.com.key -days 3650
Signature ok
subject=/C=IN/ST=Gujarat/L=Ahmeadabad/O=example/OU=mailserver/emailAddress=testuser@example.com
Getting Private key
[root@mailserver certs]#


No comments:

Post a Comment