I am getting an error when I try to copy a file from my local computer to a remote server with ssh. I get the same error whether I use cp or scp.
Here is my input at the resulting error:
[[email protected] /]# cp /home/username/some.xml [email protected]:/path/to/directory/
cp: cannot stat ‘/home/username/some.xml’: No such file or directory
I have checked, and there is definitely a file at the path /home/username/some.xml on my local machine.
Both the local computer and the remote server are running CentOS 7. How can I resolve this error and copy successfully?
ls -l /home/username/some.xml?[email protected], I typedexit, then typed thescpcommand above and it worked. The problem was that I was logged in as[email protected], so it was only seeing the directory structure ofremote.web.server, which is different than the directory structure of my local machine. Since you caused me to find this, I would be happy to accept an answer that you might submit. Thank you.