Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a old laptop that I'm using to learn Ubuntu Server 12.10. Prior to reformatting and installing Ubuntu Server, Ubuntu Desktop was used.

With Ubuntu Desktop, I was using a no-ip.com hosted domain to access the machine via ssh (no problems). After the reformat, I'm trying to use that same no-ip.com domain to access this same machine (same static ip on home LAN) but now I'm receiving the following error:

   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 a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX: (Omitted).
Please contact your system administrator.
Add correct host key in /home/guest/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/guest/.ssh/known_hosts:2
  remove with: ssh-keygen -f "/home/guest/.ssh/known_hosts" -R username.no-ip.org
ECDSA host key for username.no-ip.org has changed and you have requested strict checking.
Host key verification failed.

Admittedly, I don't understand much of the error message. After some google searching I opted to run the following command:

$ ssh-keygen -R {username.no-ip.org}

Which gives the following error:

ssh-keygen: /home/jerry/.ssh/known_hosts: No such file or directory

"Guest" as suggested in the error message, isn't there either:

jerry@mediaserver:/home$ tree -a
.
└── jerry
    ├── .bash_history
    ├── .bash_logout
    ├── .bashrc
    ├── .cache
    │   └── motd.legal-displayed
    ├── .config
    │   └── htop
    │       └── htoprc
    └── .profile

Which begs the following questions: if this file doesn't even exist, where's the discrepancy noted in the error message? Perhaps I need to create this file?

Thanks to anyone willing to work through this with me!

-Jerry

EDIT:

I should add that I am able to ssh locally using the locally assigned ip address.

share|improve this question

closed as too localized by Gilles, fabricator4, Ringtail, fossfreedom Dec 22 '12 at 7:08

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Did you run ssh as the guest account or as jerry? Did you make changes under /etc/ssh? What does ls -lA /home/guest show? –  Gilles Dec 21 '12 at 20:13
1  
Is mediaserver the Ubuntu server? Or your local machine?, because you need to edit your local machines known_hosts file not the servers. –  Shutupsquare Dec 21 '12 at 20:22
    
Thanks Stephen for that insight. That indeed is the problem (face-palm) –  jerrycrabb Dec 21 '12 at 21:32

1 Answer 1

up vote 3 down vote accepted

The warning means the host id has changed (from the old to the new installation). That's good! It works, letting you know it has changed...

Log in as the unprivileged user (not root) and create the hidden directory, /home/jerry/.ssh:

cd; mkdir .ssh; chmod 0700 .ssh

At that point you can add hosts to the known_hosts file (/home/jerry/.ssh/known_hosts).

Or, if you connect as guest, do the same as the user, guest, not jerry.

Note that should you desire the .ssh directory to be created for all new users, then add a the .ssh directory to /etc/skel. The /etc/skel directory contains files and directories that all new users should have.

sudo mkdir /etc/skel/.ssh; sudo chmod 0700 /etc/skel/.ssh

Afterward, every new user you create will have a .ssh directory with the right perms (0700).

share|improve this answer
    
This doesn't explain the guest/jerry discrepancy. –  Gilles Dec 21 '12 at 20:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.