Showing posts with label ssl. Show all posts
Showing posts with label ssl. Show all posts

Saturday, September 14, 2024

Create self certificate on Centos 5.3 (Mail Server)

Reference Website: isp mailserver with virtual users domains postfix dovecot mysql centos5.0

-----------------------------------------

mkdir -p /etc/postfix/ssl/certificate

cd /etc/postfix/ssl/certificate

openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024

chmod 600 smtpd.key

openssl req -new -key smtpd.key -out smtpd.csr

openssl x509 -req -days 365 -in smtpd.csr -signkey smtpd.key -out smtpd.crt

openssl rsa -in smtpd.key -out smtpd.key.unencrypted

mv -f smtpd.key.unencrypted smtpd.key

openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 365

-----------------------------------------

Check certificate

openssl x509 -in cacert.pem -text -noout


Saturday, March 19, 2016

การ Create user สำหรับใช้งาน Squid proxy

              การ Add user squid ผ่านทางหน้า web browser เป็นการอำนวยความสะดวกให้กับ admin หรือ IT support ที่ไม่มีความชำนาญในการใช้ Command line เพื่อเข้าไปจัดการกับระบบ user ใช้งานอินเตอร์เน็ต ส่วนการแอด user ด้วย command line อ่านได้จาก configure-squid3-proxy 
             สิ่งที่ต้องทำคือ ติดตั้ง webmin เพิ่มเข้า ดังนี้
1. install package libnet-ssleay-perl เพื่อใช้ ssl ดังนี้ * หากไม่ต้องการใช้ สามารถข้ามข้อนี้ไปได้เลย
#apt-get install -y libnet-ssleay-perl

2. ไปที่เว็บไซต์ http://www.webmin.com/download.html



ก็อปปี้ Link http://prdownloads.sourceforge.net/webadmin/webmin-1.791.tar.gz แล้วดาวน์โหลด

#wget http://prdownloads.sourceforge.net/webadmin/webmin-1.791.tar.gz
unzip file tar.gz
#tar zvxf http://prdownloads.sourceforge.net/webadmin/webmin-1.791.tar.gz
ติดตั้ง webmin
#sh webmin-1.791/setup.sh
Configure
- Web server port (default 10000): Enter ผ่าน
- Login name (default admin): sysadmin เปลี่ยน user login webmin
Login password: ใส่พาสเวิร์ด 2 ครั้ง
Password again:
- Use SSL (y/n): y เปิดใช้งาน ssl ซึ่งเวลาเรียกใช้งาน https://
- Start Webmin at boot time (y/n): y ให้ใช้งานได้ทุกครั้งที่เปิดเครื่อง

* หากต้องการถอด webmin ให้ใช้คำสั่ง
sh /etc/webmin/uninstall.sh

3. การเรียกใช้งานเปิด Browser แล้วพิมพ์ url: ตัวอย่าง https://proxy:10000/


ใส่ user name and password webmin


4. เมนูด้านซ้าย คลิ๊กไปที่ Server -> Squid Proxy Server


5. คลิ๊กไปที่เมนู Proxy Authentication 



6. คลิ๊ก Add a new proxy user 
7. สร้าง user สำหรับใช้งาน
8. กลับมาที่เมนูสร้าง user จะแสงรายชื่อผู้ใช้งานที่มีอยู่แล้ว และที่เราสร้างใหม่ สำหรับการเพิ่ม ลบ หรือเปลี่ยน password user จะต้องกดปุ่ม Apply Changes ที่มุมบนด้านขวาของจอ เพื่อปรับค่า configure ให้ใช้งานได้ ดูรูปด้านล่าง 

With the right ACLs, access to your proxy server can be limited to the users listed below, taken from the file /etc/squid3/passwd. After adding, deleting or changing a user you must use the Apply Changes link for the modification to take effect.


9. ปิด Browser และเปิดใหม่อีกครั้งเพื่อทดสอบ user ที่เราสร้างขึ้น ที่สำคัญอย่าลืม proxy ให้กับ Browser นั้น ๆ ด้วยนะครับ




Wednesday, April 16, 2014

dovecot with ssl (995)

Reference:



Howto: Linux Dovecot Secure IMAPS / POP3S SSL Server configuration

by on July 16, 2007 · 1 comment· LAST UPDATED July 16, 2007
Q. How do I configure Dovecot IMAPS and POP3s server using SSL certificate? Can I use SSL certificates generated for Postfix mail server?
A. Dovecot is an IMAP server for Linux/UNIX-like systems, written with security primarily in mind. It also contains a small POP3 server. It supports mail in either of maildir or mbox formats.
You need to enable POP3s and IMAPS. Open default configuration file:
# vi /etc/dovecot.conf
Make sure POP3S and IMAPS are enabled:
protocols = imaps pop3s
Next you must set PEM encoded X.509 SSL/TLS certificate and private key. They're opened before dropping root privileges, so keep the key file unreadable by anyone but root (see how create certificate CSR and configure certificates for Postfix):
ssl_cert_file = /etc/postfix/ssl/smtp.theos.in.crt
ssl_key_file = /etc/postfix/ssl/smtp.theos.in.key

If key file is password protected, give the password using ssl_key_password directive:
ssl_key_password = myPassword
Save and close the file. Restart Dovecot server:
# /etc/init.d/dovecot restart