RedHat 5.4 stunnel配置

來源:互聯網
上載者:User

下面可以使用stunnel實現郵件伺服器加密的pop smtp imap訪問。
 
stunnel是什麼,這裡就不介紹了,詳細請看stunnel 官方網站http://www.stunnel.org
 
首先檢查安裝包
 
[root@mailsvr12 /]# rpm -qa|grep -i stunnel
stunnel-4.15-2.el5.1
 
STUNNEL的關鍵在於PEM密鑰,
 
產生密鑰最速方法是在官網的隱藏位置http://www.stunnel.org/pem/能夠線上產生,密鑰,輸入私人的資料即可產生對應的密鑰。
 
將產生的密鑰複製到/etc/stunnel/stunnel.pem裡面,清空之前的。沒有的話,建立這個檔案。
修改許可權
[root@mailsvr12 /]# chmod 600 /etc/stunnel/stunnel.pem
 
下面是設定檔。
[root@mailsvr12 /]# cat /etc/stunnel/stunnel.conf
# Sample stunnel configuration file
cert = /etc/stunnel/stunnel.pem     #密鑰存放位置
chroot = /var/run/stunnel/
# PID is created inside chroot jail
pid = /stunnel.pid
setuid = nobody
setgid = nobody
[pop3s]
accept  = 995
connect = 110 
[imaps]
accept  = 993
connect = 143
[ssmtp]
accept  = 465
connect = 25
 
---------------------------------------------------------------------------
 
上面的stunnel.conf檔案裡面需要注意的
/var/run/stunnel/  要建立這個檔案,nobody使用者有讀寫權限
 
啟動stunnel
 
[root@mailsvr12 /]# /usr/sbin/stunnel &        -將這句添加到/etc/rc.local裡面隨機啟動。
 
ps -ef  查看進程,看到如下。
nobody    4134     1  0 09:22 ?        00:00:00 /usr/sbin/stunnel
 
 
本文出自 “西安創越網路|西安企業郵箱|企業郵箱” 部落格,請務必保留此出處http://chenzhuo.blog.51cto.com/150592/238570

本文出自 bkjia.com技術部落格

[root@mailsvr12 /]# netstat -nap|grep stunnel
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      4134/stunnel       
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      4134/stunnel       
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN      4134/stunnel       
unix  2      [ ]         DGRAM                    4418813 4134/stunnel 
 
可以看到連接埠正常偵聽。然後foxmail或者outlook之類的郵件用戶端就可以使用加密的通道訪問郵箱了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.