scp files from local to remote machine error: no such file or directory

Looks like you are trying to copy to a local machine with that command.

An example scp looks more like the command below:

Copy the file “foobar.txt” from the local host to a remote host

$ scp foobar.txt [email protected]:/some/remote/directory

scp “the_file” your_username@the_remote_host:the/path/to/the/directory


to send a directory:

Copy the directory “foo” from the local host to a remote host’s directory “bar”

$ scp -r foo [email protected]:/some/remote/directory/bar

scp -r “the_directory_to_copy” your_username@the_remote_host:the/path/to/the/directory/to/copy/to


and to copy from remote host to local:

Copy the file “foobar.txt” from a remote host to the local host

$ scp [email protected]:foobar.txt /your/local/directory

scp your_username@the_remote_host:the_file /your/local/directory


and to include port number:

Copy the file “foobar.txt” from a remote host with port 8080 to the local host

$ scp -P 8080 [email protected]:foobar.txt /your/local/directory

scp -P port_number your_username@the_remote_host:the_file /your/local/directory


From a windows machine to linux machine using putty

pscp -r <directory_to_copy> username@remotehost:/path/to/directory/on/remote/host

Leave a Comment