Linux

How to verify that SSL for IMAP/SMTP works and a proper SSL certificate is in use

Credit Robert Asibekov

IMAP via SSL using port 993

openssl s_client -showcerts -connect mail.example.com:993 -servername mail.example.com
Server certificate
subject=/OU=Domain Control Validated/OU=PositiveSSL/CN=mail.example.com
issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=PLAIN IDLE ACL ACL2=UNION] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc. See COPYING for distribution information.

SMTP via TLS/StartTLS using port 25 or 587

openssl s_client -starttls smtp -showcerts -connect mail.example.com:25 -servername mail.example.com
Server certificate
subject=/OU=Domain Control Validated/OU=PositiveSSL/CN=mail.example.com
issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
250 DSN

 

 

Get Numeric File/Directory Permissions

stat -c %a /etc/hosts
644

Mount SMB Share in fstab Ubuntu

Username/Password in connect string

vi /etc/fstab
#theShare
//theServer/theShare  /mnt/theMount  cifs  vers=3.0,username=theUsername,password=thePassword,uid=1000,gid=104,iocharset=utf8,file_mode=0777,dir_mode=0777,nounix  0  0

Username/Password in credentials file

vi /home/username/.smbcredentials
#username=MyUsername
#password=MyPassword

# OR:
username=MyUsername
password=MyPassword
domain=MYDOMAIN
chmod 660 /home/username/.smbcredentials
vi /etc/fstab
#theShare
//theServer/theShare  /mnt/theMount  cifs  vers=3.0,credentials=/home/username/.smbcredentials,uid=1000,gid=104,iocharset=utf8,file_mode=0777,dir_mode=0777,nounix  0  0