I am trying scp -r usernameipaddress:/path /pathwhereIwanttocopy
, but I am getting it as connection refused.
How can I get it? How can I get connected?
SCP syntax is pretty simple. Just invoke SCP followed by the remote username, @, the IP address or host, colon, and the path to the file. If not specified, the default path is the remote user's home directory. Then, define the local path where the file will be stored locally.
Copy and paste the required file from the remote machine in the cloud storage disk. Now, the file will appear in the file transfer window as shown below. Click the download icon against the file. Now the file will be downloaded to your local machine.
The scp command issued from the system where /home/me/Desktop resides is followed by the userid for the account on the remote server. You then add a ":" followed by the directory path and file name on the remote server, e.g., /somedir/table. Then add a space and the location to which you want to copy the file.
You can use either scp or rsync to copy folder and files from local to ssh or copy folder and files from ssh to local within in the same or different directory. By default copy files and folders happen sequentially. If you wish to copy directory and contents in parallel then you must use pscp or pssh tool.
The -r flag should work. In your example you seem to be forgetting the name of the folder you want to copy. Try:
scp -r nameOfFolderToCopy username@ipaddress:/path/to/copy/
to copy a folder from your local computer to a remote one. Or
scp -r username@ipaddress:/path/of/folder/to/copy /target/local/directory
to copy a folder from a remote machine to your local one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With