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 someuser@domain.com:/home/someuser/foo.txt

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

The authenticity of host 'domain.com' 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?

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

This question was marked as an exact duplicate of an existing question.

  • 1
    @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

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.

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