Forums

Broken git push deployments after password change

I changed my pythonanywhere password and now my git push deployments have stopped working.

I originally followed this blog to set the deployments up https://blog.pythonanywhere.com/87/ but it's not prompting me for a password when I reset the remote and push results in: ssh: connect to host ssh.pythonanywhere.com port 22: Connection refused.

Trying to ssh into the server also results in this:

$ ssh -v jcuturtlehealth@ssh.pythonanywhere.com
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to ssh.pythonanywhere.com port 22.
ssh: connect to host ssh.pythonanywhere.com port 22: Connection refused

Any ideas on how I can fix this?

I fixed this by added my ssh public key to the pythonanywhere server.

https://www.linode.com/docs/security/authentication/use-public-key-authentication-with-ssh/

The "connection refused" message normally happens if you try to SSH in with the wrong password several times in quick succession -- the server interprets this as an attempt to hack in by brute-forcing the password, and locks your IP address out for an hour. Is it possible that you tried to do a push-deploy with the wrong password a few times, and then posted your first message? If so, perhaps the server locked you out, and it was the timeout on the lockout that fixed the problem rather than the change to using an SSH key.