-2

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?

snoopy76
  • 103
  • 1
  • 3

1 Answers1

3

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.

Hauke Laging
  • 5,285
  • 2
  • 24
  • 40