Mastodon

Cloudflare and ssh

If you are using Cloudflare as firewall for content delivery then please note that Cloudflare only proxies http/https traffic. i.e., it would be impossible to reach your server through any other service like ssh/ftp/sftp etc.

If you need to connect to your origin using another protocol (SSH, FTP, SMTP, etc.) you need to do so using a record that does not have Cloudflare enabled in the DNS settings (grey cloud) or by connecting directly to the origin server’s IP address.

For example, if your domain is example.com, connect to server using a grey url like

$ ssh user@ssh.example.com

where ssh.example.com is an A record pointing to same ip as example.com.

Unlocking ssh private key per shell session

When you have a password protected ssh private key, you need it to be unlocked every time you want to use the it for authentication purpose.  This leads to password prompts every time the private key is been used.  If you want this to be avoided for the current shell session then below combination of command will help you achieve that.

$ eval `ssh-agent -s`
$ ssh-add <absolute path to the private key>

Once added, until you logout from the current shell where the ssh-agent is running, you wont be prompted to unlock the private key again.

Very handy for a long running linux pc / server.

Bypass ssh key unlock prompt in mac os x

In Mac OS X, if you have a password protected ssh private key then every time you use this key to connect to a remote server, a password prompt will appear.  If you want to avoid this popup then pass the below option to ssh in the command line:

$ ssh -o AskPassGUI=no <serverToConnect>

If you dont want to mention this every time then you can also mention this in ssh_config file.