Im pretty new to SSH, Linux AND Amazon EC2, but from my understanding this should be very simple. What am I missing here?
I am unable to connect to my EC2 instance
I have a local machine running Fedora 15 with minimal modifications. I am connecting to an AWS EC2 instance through the terminal using a .pem file. I believe I have all settings configured properly on amazons interface: enabling neccessary permissions and setting up instance properly with elastic ip etc. This is the command I am typing in terminal while logged in as root user on local machine:
[root@localhost /]# ssh -i mainbackup.pem ec2-user@elasticiphere
I get this in return:
Warning: Identity file mainbackup.pem not accessible: No such file or directory.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
<<RSA key here but I removed>>
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:1
RSA host key for elasticiphere has changed and you have requested strict checking.
Host key verification failed.
I understand this is telling me I need to make modifications to the known hosts file located in .ssh directory….however I cannot find the .ssh directory to address the situation! I run cd ../ until root directory, and then run ls to list folders, and .ssh is not one of them. Ive ran the same commands from home and cannot find .ssh. Ive searched through fedora interface and cannot find the directory. Does anyone know where or how I can find this file? Or, am I interpretting this error message wrong and there is perhaps a different solution?
This might be the problem:
If the file exists, it can be permission problem. Make sure that the file is accessible.
try:
the .ssh directory is usually under your home to access it, try
cd ~/.ssh