All of the configuration on the VPS for SSL/TLS has to be done from the command line of the VPS, as the root user. Please see the SSH User Guide for more information. |
[root@example ~]# cd /etc/pki/tls/certs [root@example certs]# ll total 448 -rw-r--r-- 1 root root 441017 Jan 8 2009 ca-bundle.crt -rwxr-xr-x 1 root root 610 Jan 8 2009 make-dummy-cert -rw-r--r-- 1 root root 2251 Oct 13 08:57 Makefile -rw-r----- 1 root ldap 2352 Jan 18 14:43 slapd.pem [root@example certs]# |
[root@example certs]# make sendmail.pem umask 77 ; \ PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \ PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \ /usr/bin/openssl req -utf8 -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \ cat $PEM1 > sendmail.pem ; \ echo "" >> sendmail.pem ; \ cat $PEM2 >> sendmail.pem ; \ rm -f $PEM1 $PEM2 Generating a 1024 bit RSA private key ...........++++++ .........................++++++ writing new private key to '/tmp/openssl.X16187' ----- 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) [GB]:US State or Province Name (full name) [Berkshire]:Georgia Locality Name (eg, city) [Newbury]:Atlanta Organization Name (eg, company) [My Company Ltd]:eApps Web Hosting Organizational Unit Name (eg, section) []:. Common Name (eg, your name or your server's hostname) []:example.com Email Address []:user@example.com [root@example certs]# |
[root@example certs]# cd /etc/mail [root@example mail]# cp sendmail.mc{,.bck} [root@example mail]# cp sendmail.cf{,.bck} [root@example mail]# [root@example mail]# vim sendmail.mc |
dnl define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl dnl define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl dnl define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl dnl define(`confSERVER_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl ~ ~ dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl |
define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl define(`confSERVER_KEY', `/etc/pki/tls/certs/sendmail.pem')dnl ~ ~ DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl |
[root@example mail]# cd /etc/mail [root@example mail]# make all [root@example mail]# service sendmail restart Shutting down sendmail: [ OK ] Shutting down sm-client: [ OK ] Starting sendmail: [ OK ] Starting sm-client: [ OK ] [root@example mail]# |
[root@example mail]# service sendmail restart sendmail: unrecognized service [root@example mail]# |
[root@example ~]# cd /etc/pki/tls/certs/ [root@example certs]# ll total 452 -rw-r--r-- 1 root root 441017 Jan 8 2009 ca-bundle.crt -rwxr-xr-x 1 root root 610 Jan 8 2009 make-dummy-cert -rw-r--r-- 1 root root 2251 Oct 13 08:57 Makefile -rw------- 1 root root 2271 Jan 28 11:26 sendmail.pem -rw-r----- 1 root ldap 2352 Jan 18 14:43 slapd.pem |
[root@example certs]# make imapd.pem |
[root@example certs]# cd /etc/xinetd.d [root@example xinetd.d]# ll imap* -rw-r--r-- 1 root root 367 Oct 13 08:56 imap -rw-r--r-- 1 root root 362 Oct 13 08:56 imaps [root@example xinetd.d]# |
[root@example xinetd.d]# sed s/'service imap'/'service imaps'/ imap > imaps |
[root@example xinetd.d]# cat imap # default: off # description: The IMAP service allows remote users to access their mail using \ # an IMAP client such as Mutt, Pine, fetchmail, or Netscape \ # Communicator. service imap { disable = no ~ ~ |
[root@example xinetd.d]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@example xinetd.d]# |
[root@example ~]# cd /etc/pki/tls/certs [root@example certs]# make /etc/stunnel/stunnel_popa3d.pem |
[root@example certs]# cd /etc/xinetd.d [root@example xinetd.d]# cat popa3ds # default: off # description: The POP3S service allows remote users to access their mail \ # using an POP3 client with SSL support such as fetchmail. service pop3s { disable = yes ~ ~ |
[root@example xinetd.d]# sed -i s/yes/no/ popa3ds |
[root@example xinetd.d]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@example xinetd.d]# |
[root@example xinetd.d]# netstat -nap | grep sendmail tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 15904/sendmail: acc tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 15904/sendmail: acc |
[root@example xinetd.d]# netstat -nap | grep xinetd tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 7582/xinetd tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 7582/xinetd |
All of the configuration on the VPS for SSL/TLS has to be done from the command line of the VPS, as the root user. Please see the SSH User Guide for more information. |
[root@example ~]# cd /usr/share/ssl/certs |
[root@example certs]# make sendmail.pem umask 77 ; \ PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \ PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \ /usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 ; \ cat $PEM1 > sendmail.pem ; \ echo "" >> sendmail.pem ; \ cat $PEM2 >> sendmail.pem ; \ rm -f $PEM1 $PEM2 Generating a 1024 bit RSA private key ...++++++ ........................................++++++ writing new private key to '/tmp/openssl.qU1787' ----- 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) [GB]:US State or Province Name (full name) [Berkshire]:Georgia Locality Name (eg, city) [Newbury]:Atlanta Organization Name (eg, company) [My Company Ltd]:eApps Web Hosting Organizational Unit Name (eg, section) []:. Common Name (eg, your name or your server's hostname) []:example.com Email Address []:user@example.com [root@example certs]# |
[root@example certs]# cd /etc/mail [root@example mail]# cp sendmail.mc{,.bck} [root@example mail]# cp sendmail.cf{,.bck} [root@example mail]# [root@example mail]# vim sendmail.mc |
dnl define(`confCACERT_PATH', `/usr/share/ssl/certs') dnl define(`confCACERT', `/usr/share/ssl/certs/ca-bundle.crt') dnl define(`confSERVER_CERT', `/usr/share/ssl/certs/sendmail.pem') dnl define(`confSERVER_KEY', `/usr/share/ssl/certs/sendmail.pem') ~ ~ dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl |
define(`confCACERT_PATH', `/usr/share/ssl/certs') define(`confCACERT', `/usr/share/ssl/certs/ca-bundle.crt') define(`confSERVER_CERT', `/usr/share/ssl/certs/sendmail.pem') define(`confSERVER_KEY', `/usr/share/ssl/certs/sendmail.pem') ~ ~ DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl |
[root@example mail]# cd /etc/mail [root@example mail]# make all [root@example mail]# service sendmail restart Shutting down sendmail: [ OK ] Shutting down sm-client: [ OK ] Starting sendmail: [ OK ] Starting sm-client: [ OK ] [root@example mail]# |
[root@example mail]# service sendmail restart sendmail: unrecognized service [root@example mail]# |
[root@example ~]# cd /usr/share/ssl/certs |
[root@example certs]# make imapd.pem |
[root@example certs]# cd /etc/xinetd.d [root@example xinetd.d]# ll imap* -rw-r--r-- 1 root root 367 Oct 13 08:56 imap -rw-r--r-- 1 root root 362 Oct 13 08:56 imaps [root@example xinetd.d]# |
[root@example xinetd.d]# sed s/'service imap'/'service imaps'/ imap > imaps |
[root@example xinetd.d]# cat imap # default: off # description: The IMAP service allows remote users to access their mail using \ # an IMAP client such as Mutt, Pine, fetchmail, or Netscape \ # Communicator. service imap { disable = no ~ ~ |
[root@example xinetd.d]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@example xinetd.d]# |
[root@example ~]# cd /usr/share/ssl/certs [root@example certs]# make /etc/stunnel/stunnel_popa3d.pem |
[root@example certs]# cd /etc/xinetd.d [root@example xinetd.d]# cat popa3ds # default: off # description: The POP3S service allows remote users to access their mail \ # using an POP3 client with SSL support such as fetchmail. service pop3s { disable = yes ~ ~ |
[root@example xinetd.d]# sed -i s/yes/no/ popa3ds |
[root@example xinetd.d]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@example xinetd.d]# |
[root@example xinetd.d]# netstat -nap | grep sendmail tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 15904/sendmail: acc tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 15904/sendmail: acc |
[root@example xinetd.d]# netstat -nap | grep xinetd tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 7582/xinetd tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 7582/xinetd |