Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Host key verification failed on scp

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
kmchen
Posts: 74
Joined: 2013-04-24 06:29

Host key verification failed on scp

#1 Post by kmchen »

Hi,

I have all SSH keys in places and I can do scp from a remote host to my local machine like this:

Code: Select all

scp root@remoteHost:file /tmp/
But I get error "Host key verification failed" if I want to copy on the same remote host like this:

Code: Select all

scp root@remoteHost:file root@remoteHost:/tmp/
I precise I need that curious looking command for a modular script writing
Any idea welcome

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: Host key verification failed on scp

#2 Post by peter_irich »

Not use root for SSH. Send file as user to user, then turn on as user by SSH and copy this file on remote computer as root.

Peter.

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: Host key verification failed on scp

#3 Post by reinob »

kmchen wrote: But I get error "Host key verification failed" if I want to copy on the same remote host like this:

Code: Select all

scp root@remoteHost:file root@remoteHost:/tmp/
Login to root@remoteHost, then edit .ssh/known_hosts and delete the line referring to remoteHost.
You (or somebody on your behalf :) probably changed the host keys at some point.

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Host key verification failed on scp

#4 Post by Dai_trying »

I would just issue the command using ssh, something like this

Code: Select all

ssh user@ipaddress "mv ~/tempfile.txt /tmp/"
Not sure it would work with root though but I guess if you ssh in as root (and have root login enabled) then I can't see it being a problem.

Post Reply