Ubuntu Passwordless and Public Key Authentication

1. Need to generate a local public key file from client machine

# ssh-keygen -t dsa 


( from client machine)

2. Copy the file to the server

# scp ~/.ssh/id_dsa.pub user@linuxfreaks.in:/home/user

3. Login to the server and add the key to authorized_keys file

# cat id_dsa.pub >> .ssh/authorized_keys

4. Delete the original file you copied

# rm -r id_dsa.pub

All done, now just ssh to the server. It will login without the password.

Note : Passwordless authentication is a big security risk.

Add swap on CentOS and Ubuntu Linux

1. Create a swap file.

dd if=/dev/zero of=/mnt/swapfile bs=1024 count=4096k


This will create a 4GB of swap file which can be used for 8GB server.

2. Change the file to swap partition.

mkswap /mnt/swapfile

3. Enable swap

swapon /mnt/swapfile


4. Verify swap partition.

swapon -s


NOTE: All the above operations need to be done with a sudo user or by root.

Zimbra & Sendgrid SMTP Setup

All the operations need to be done as a Zimbra user.

1. Point a domain to an SMTP server

zmprov ms mail.example.com zimbraMtaRelayHost smtp.sendgrid.net


2. Add SMTP authentication for smtp relay server

echo smtp.sendgrid.net username:password > /opt/zimbra/conf/relay_password


3. Export it to postfix

postmap hash:/opt/zimbra/conf/relay_password


4. Check the credentials are saved properly

postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password


5. Setup SASL to use smtp relay authentication Continue reading Zimbra & Sendgrid SMTP Setup