Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is an exact duplicate of:

I'm trying to SCP a file from my server to another server. The command I'm using is:

scp -i private.ppk -P 22 foo.txt

When I run this via the command line, I get prompted:

The authenticity of host '' can't be established.
RSA fingerprint is: ...
Are you sure you want to continue connecting (yes/no)?

Since I need to do this via PHP (and not the command line), I can't be bothered by these prompts. I think I need to set something in the known_hosts_file to prevent this prompt. Is that correct? If so, how do I do that? How do I set up my server's known_hosts_file so that I don't get prompted?

share|improve this question

marked as duplicate by cjc, Sven, EEAA, Michael Hampton, Jacob Apr 23 '13 at 2:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

@EEAA I don't see how these questions are to be equal. – Hauke Laging Apr 23 '13 at 1:08
Have you never used ssh before?! – Michael Hampton Apr 23 '13 at 1:48
up vote 2 down vote accepted

You are asked just once. You can copy the respective entry from the ~/.ssh/known_hosts file to the same file for other users. Or you put it into /etc/ssh/ssh_known_hosts then it's valid for all users.

share|improve this answer

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