Tag Archives: SSH

See unread mail on SSH login

In the previous post, I explained how to set up your mail server. Now an extra tip on how to read your mail. If you have your own server, you will probably log in via SSH to administer it. Would it not be nice to be greeted with a message if you have new mail? That’s quite easy. Edit the files /etc/pam.d/login and /etc/pam.d/sshd and find the line with pam_mail.so on it. Make it look like
session    optional   pam_mail.so standard dir=~/.mail
If you have another directory where Dovecot stores your mail, change it. To read your mail, type mail to read it. It might be necessairy to install the package heirloom-mailx by first typing aptitude install heirloom-mailx

Updating WordPress and plugins with SSH

WordPress allows upgrade of itself and of plugins via a nice web interface. By default, it offers the option between FTP and FTPS. That’s very nice except that my server does not use FTP, only SSH. Fortunately, WordPress can support SSH if the correct package is installed. On a Debian server, simply run:
sudo aptitude install libssh2-php
Then restart the web server. If you now go to the upgrade page, there is an option to use SSH. You can either use a password-based login, or a public/private key-based login.