Passwordless login on PythonAnywhere from Mac

So you want to login by SSH to your PythonAnywhere installation without using a password from your Mac?

First login to your PythonAnywhere account like so:

$ ssh <username>

NB: <username> is your PythonAnyhwre username. Not your email address. The password is the same password you use to login to the web site.

When logged in, create a .ssh folder in your home-folder like so:

mkdir .ssh

Now logout, and create and create a SSH public/private key pair on your Mac like so:

cd .ssh
$ ssh-keygen -t rsa -f name-of-your-key

This generates:


Now, from your Mac run this command to append your public key to authorized_keys on the remote PythonAnywhere host:

$ cat ~/.ssh/ | ssh <username> 'cat >> .ssh/authorized_keys' 

Also create a config locally on your Mac in ~/.ssh/config:

Host PythonAnywhereName
    Port 22
    User <username>
    IdentityFile ~/.ssh/name-of-your-key

Now you can login like so:

$ ssh PythonAnywhereName