Forums

Amazon AWS - SSH Access (Ubuntu Live 14.04)

Hi,

I am trying to access my Amazon AWS AMI EC2 console (following along the TDD Python page by your alma mater Harry P-- ) and am trying to ssh in.

I performed the following command:

chmod -400 ToppyTippySecretKey.pem

Followed by my ssh command:

ssh -i ToppyTippySecretKey.pem root@36.120.81.14

The output of which was as follows:

The authenticity of host '36.120.81.14  (36.120.81.14 )' can't be established.
ECDSA key fingerprint is 12:a1:14:ah:17:16:98:a7:b4:15:15:29:4c:d7:d2:d8.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/jpythonlearner/.ssh/known_hosts).

(Note* All the specific IPs above,etc, were changed) I've done a little search and it seems I may not have permissions to change/modify my known_hosts file? (I've also tried instead of root@, ubuntu@) Is this the case? Or is there something specific to PythonAnywhere that I need to do to access other sites via ssh?

Thanks!

P.S> Not a free account at the moment-- so don't believe I've to worry about a whitelist.

A quick way to check permissions from your bash console:

ls -l ~/.ssh/known_hosts

This should return something like

-rw-r--r-- 1 jpythonlearner registered_users 7970 May 23 15:03 /home/jpythonlearner/.ssh/known_hosts

Is this what you see?

Hi,

I'm getting the following (included a pwd just in case the location of running the command matters):

14:05 ~ $ pwd
/home/jpythonlearner
14:05 ~ $ ls -l ~/.ssh/known_hosts
ls: cannot access /home/jpythonlearner/.ssh/known_hosts: Not a directory
14:05 ~ $

I'm guessing this is incorrect?

Ohh. I just took a look at your file structure. You have a file called .ssh. That is not correct. Instead, you need a folder called .ssh. Then the known_hosts file should be able to autogenerate itself when you run your ssh commands.

Ah- success! Thanks, didn't realize .ssh was supposed to be a directory.

:)