Tag: SSH

Moving and Sharing Email files on cPanel

It initially seemed easy enough, but turned out it was not. I moved a customer to a new host, and she wanted a copy of all her emails on the old host.

So I ssh’d into both and copied over the /mail directory, which contained all her emails. Now I had a copy of all her email on the new server.

The mail directory structure is:
/mail
/.person2@domain-name_com
/.subdirectory-name
/cur

Within the cur directory are message files with names such as

1503689147.M825641P101251.box909.host-provider.com,S=16683374,W=16900128:2,RS

Generating htpasswords through SSH

If you are on Ubuntu and do not want to install htpasswd, SSH into your server

htpasswd -n id

You will be prompted, twice, for a password. The key will be generated on screen

-n: generate key on screen
id: chosen id
password: chosen pw
code will be generated, add this to password file

Notes:
password file not available from FTP
Brute Force Attacks
htpasswd

SSH Transfers Between Servers: Summary

SSH is a unix tool you can use to facilitate secure and fast transfers between servers, or between your desktop and a server. Instead of transferring a file from server A to your PC and then from your PC to server B, you can more directly transfer files from Server A to server B.

You will need SSH credentials for both servers. These credentials include an ID, the server name, port and a password. You will need to get these from your server admin, or your ISP. Once you have these, start a terminal each and “SSH id@servername”. You will be prompted for a password. Once you login your terminal prompt will change, showing you that you’re on a different server. Keep both open. From the receiving server you can do the scp command. This seems the easiest.