How do I view what exim is doing?

Exim comes with a utility called ‘exiwhat’ which will display what each instance of exim is currently involved with. The output will look similar to this:

root@server [~]# exiwhat
2118 daemon: -q1h, listening for SMTP on port 25 (IPv4)
2130 daemon: no queue runs, listening for SMTPS on port 465 (IPv4)
31640 handling incoming connection from [1.2.3.4]

Also, to monitor the exim log in realtime, you may use the tail command thusly:

tail -f /var/log/exim_mainlg

SSH Authorized Keys Automatic Login

SSH can automatically authenticate connections when the client presents an authorized key. A client gives it’s public key to a server and then when it connects the server knows it’s allowed in and automatically allows the connection. The Keys are specific to users, so a key for user_a will not let user_b in.

Few Simple Steps

  1. Create Keys

    If the keys don’t exists already you must create them. Look in your ~/.ssh for files called id_rsa and id_rsa.pub. If those files don’t exist say ssh-keygen -b 2048 -t rsa to create them.

  2. Place Keys on Server

    Copy id_rsa.pub to the server then append that to ~/.ssh/authorized_keys

Optionally you can use a DSA key, simply replace `rsa` with `dsa` above

SSH automatic login assistance script

The script automatically pushes your SSH private key to the server specified so you can have automatic SSH,scp and sftp authentication. If you don’t have a key the script will generate one for you, also this script assumes that the user running the script has a home directory on the remote host. Should note that this script will only push the RSA encrypted key.

The Script

 

 

#!/bin/bash

# say: ./ssh_script.sh hostname

# Uploads your id_rsa.pub to the specified host, wrapped for readability

if [ ! -r ${HOME}/.ssh/id_rsa.pub ];then

ssh-keygen -b 2048 -t rsa

fi

# Append to the copy on the remote server

cat ~/.ssh/id_rsa.pub | ssh ${USER}@$1 “cat – >> .ssh/authorized_keys”

if [ $? -eq 0 ]; then

echo “Success”

fi

save the script say as  ssh_script.sh and execute it ./ssh_script.sh hostname