Host key verification failed on scp

If none of the more specific forums is the right place to ask

Host key verification failed on scp

Postby kmchen » 2018-03-06 17:03

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
Développeur WEB
http://www.webologix.com
kmchen
 
Posts: 25
Joined: 2013-04-24 06:29

Re: Host key verification failed on scp

Postby peter_irich » 2018-03-06 17:43

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.
peter_irich
 
Posts: 1227
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Host key verification failed on scp

Postby reinob » 2018-03-07 18:43

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.
reinob
 
Posts: 541
Joined: 2014-06-30 11:42

Re: Host key verification failed on scp

Postby Dai_trying » 2018-03-08 08:36

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.
Dai_trying
 
Posts: 447
Joined: 2016-01-07 12:25


Return to General Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable