Forums

cannot connect via ssh to Amazon Web Services

I haven't tried accessing my AWS instance via SSH from pythonanywhere in a while. I used to be able to access it using, for example:

ssh -i PathToSecurityKeyOnPythonAnywhere root@ec2-107-20-73-78.compute-1.amazonaws.com

Now I get an error. The error is:

ssh: connect to host ec2-107-20-73-78.compute-1.amazonaws.com port 22: Connection refused

Anyone see what I am doing wrong or has something changed about PythonAnywhere accounts?

I see amazonaws.com on the whitelist for access by free accounts. I cannot honestly say if I have tried this route since the whitelist was instituted, but using PuTTY on my Windows machine allows me access the same instance and so I don't think it is anything particular to the instance I am trying.

(By the way, that is not the actual address of the particular instance I was trying but an old one. I didn't think it made a difference for the example and was thinking it was more secure not to post an actual instance I actively use.)

We don't allow connections out from Free accounts except for http(s) to specific hosts on our whitelist.

Thanks, Glenn. I figured that was it, but I wanted to confirm.

Is this why I can't git clone from my own computer? It would be nice if it had a more informative message than "connection refused", if it's being blocked locally.

I read https://www.pythonanywhere.com/wiki/ExternalVCS and spent a lot of time and pain setting up the other end of the serverless git thing and then it seems pythonanywhere can't connect to it. :'(

got it working through bitbucket :)

@thecutestthing, it's a bit hard to explain:

  1. from pythonanywhere, free users can only make

    a) http/https connections to whitelisted sites

    b) git/smtp/ssh/other connections to a very few specific services (git@github, git@bitbucket, smtp@gmail, but not ssh to random amazon ec2 instances)

  2. from their own computers, people can SSH into pythonanywhere only if they have a paid account. so you can store bare repositories on PA, but you can't push to them unless you have a paying account.

hope that makes more sense!