Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-29-2011, 06:38 AM   #1
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
Host key verification failed

Hi all

I know that there are multiple threads with problems like this, but still i didn't found my answer.

The situation is like this:
I have a local server and a remote server, i did a ssh key swap so i can log on to the remote server with no problems (automatically logging on, no need to enter pass or login).
I've made a script that copies (with SCP) a file FROM the REMOTE server TO the LOCAL server (NOT FROM the LOCAL server to the REMOTE server !!!!), and then i get an error like:
Host key verification failed.
A detail you might need to know:
- i can still log on from the LOCAL to the REMOTE server (with no need to fill in login and pass) -> through a script or with the command line (ssh user@host)

Does anyone know the answer for this?


Last edited by brownie_cookie; 03-29-2011 at 06:39 AM.
Old 03-29-2011, 06:47 AM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Is your script logging in to the remote server as you or a different account? Also, it's not important which way you're copying files, only which end you're executing the script on

ssh into remote host then:
scp /path/to/file user@<local_host>:/local/directory

or on local host:
scp user@<remote_host>:/path/to/file /local/directory

Which example matches what you're doing ?
Old 03-29-2011, 06:56 AM   #3
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
first i copy the script from the local to the remote with SCP
then this script is been executed and gives a result (which he puts in a file on the remote server)
then that file must be copied back to the local server

so FIRST i do:
scp /path/to/file user@<REMOTE_HOST>:/REMOTE/directory

then i do:
scp user@<remote_host>:/path/to/file /local/directory

(notice the words in bold are changed of what you said, i don't say it's wrong but i just want you to know what i've used compared to what you suggested)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GRsync Error! Host key verification failed... linustalman Linux - Networking 2 01-27-2011 12:19 PM
scp - Host key verification failed. Hellbike Linux - Server 2 05-30-2010 03:16 AM
Ssh problem: Host key verification failed redfeet Linux - Server 3 02-11-2010 11:39 AM
OpenSSH Host Key Verification Failed GodSendDeath Linux - Software 12 01-21-2005 12:28 PM
to 2.6.10 from 2.4.26 | ssh client | Host key verification failed kaN5300 Slackware 6 01-05-2005 10:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration