There are a number of similar questions here.
But I spent more the four hours til I found searching for a solution to an SCP error (“No such file or directory”) that addressed my specific situation. Here’s the fix:
When I try to copy a file with SSH using the SCP (Secure Copy Protocol) I receive an error
No such file or directory
This was because I was run the SCP command while logged in to the remote server. This caused the server to look for the destination folder (the one you’re copying files to) on itself, which wouldn’t exist.
Log out from the remote server. Repeat the command. This ensures the command runs on your local machine, allowing you to specify the remote server as the destination. And high probably you’ll stop seeing the “No such file or directory”
My account reputation here doesn’t allow leaving neither comments not votes. That’s why I’m asking and answering the question myself. Maybe this could save others hours of searching for the fix.