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 was using scp and ssh suddenly some warning about

SOMETHING NAST!

man-in-the-middle attack

From that moment when that warning appeared till now, I can copy files via sftp but it is impossible to use scp. What's going on? I tried removing .ssh/known_hosts but it is always the same. When scp myfile user@server:/Folder, I get the following message.

scp: /Folder: Permission denied

share|improve this question

2 Answers 2

up vote 1 down vote accepted

first, this is a security issue.

Here is a nice review article:

http://www.symantec.com/connect/articles/ssh-host-key-protection

Basically ssh servers (openssh-server) use keys to identify themselves and prevent others from mimicking them. A "man in the middle" might, for example, capture your user name and password.

You can fix it via several methods, I prefer

ssh-keygen -R server

Before you do that, however, you should check with the server sys admin to see if the (server) keys were changed.

For your scp error, you need to use the full path. My guess would be:

scp myfile user@server:/home/user_name/Folder
share|improve this answer
    
Thank you so much. –  Mario Jan 12 '12 at 0:24

This will also happen if you have migrated a server onto another piece of hardware or changed IP Addresses. Generally, I copy the known_hosts file to a .bak; vi the file and remove the offending key. Then when I ssh in again, it prompts for the password and with permission adds it to the known hosts. You don't even have to put in a password, just say yes to known_hosts.

As stated previously though - SOMETHING changed so you need to find out what. These errors don't just magically appear so use caution!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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