Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by cjc, SvW, 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.

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
add comment

1 Answer

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
add comment

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