I am trying to copy a file from one machine to another machine via ssh. Both machines are Ubuntu servers. Both machines have exchaged keys so that they can log into each other without passwords.
The command I have looks like this (details changed for privacy, of course):
scp -i /var/www/place/.ssh/id_rsa file.tar.gz [email protected]:directoryName/file.tar.gz
However, every time I run it, I get this error:
Could not create directory '/var/www/.ssh'.
Host key verification failed.
lost connection
It seems like the scp
command is trying to create a directory called .ssh
one level up from place
.
What's going on here? Does scp need to create some kind of temporary directory in order to execute?
The user account that is running the command has read/write permissions within /var/www/place, but not /var/www, so how do I get this scp command to run?
(Please be aware I am not very experienced with Linux command line stuff, so please make answers verbose and simple. Thanks for your understanding.)