SCP provides file or directory not found

I have a problem. I use the SCP command to transfer files from my mac osx desktop to my virtual server too. The fact is that I ran the command and successfully transferred one file from my desktop to the server, without any problems. So I use the same command as: scp (the name of the file I want to transfer) user @serverip: So basically it looks like โ†’ scp test user@10.0.0.0 : (I just used a random IP for the exmaple. File im trying to transfer, which is also in document format, I constantly get No such file or directory Any ideas on why this might happen?

+6
source share
2 answers

Try the following syntax:

Sending a file from the server from which you transfer the command to another server:

scp /path/to/file.doc user@ <IP or hostname>:/path/to/where/it/should/go/ 

Receiving a file from another server to the one with which you issue the command:

 scp user@ <IP or hostname>:/path/to/file.doc /path/to/where/it/should/go/ 

This is the format that I reliably use to copy from location to another location. You can use an absolute path or a relative / special character path, for example scp suiterdev @fakeserver: ~ / folder / file. which will "safely copy as suiterdev on the fakeserver host a file named" file "in the location" home for user suiterdev "/ folder / (" user home ") to the folder" where I work from this server "(point is the current location).

Hope this helps.

+10
source

Good thing I'm using Ubuntu 15.10, and this is what worked for me.

scp user@host.com : path /to/file.txt/home/to/local/folder/

instead

scp user@host.com : /path/to/file.txt/home/to/local/folder/

Note that after the user user@host.com host I do not include the forward slash, I immediately add the folder after ":"

When I turn on the slash on my host, I realized that "SCP gives the file or the directory was not found."

+4
source

Source: https://habr.com/ru/post/978744/


All Articles