0

I'd like to move a folder that contains multiple files within it from my local folder to a ssh user@xxx.xxx.xx.xx machine's temp drive. What would be the best method in doing this? Thanks for your help.

Kusalananda
  • 333,661
itsmevic
  • 3
  • 1

1 Answers1

2

You will need to be able to ssh as a user who has write permissions to that system's /tmp directory or wherever you are trying to copy the filed. Assuming that you can:

rsync -avhH /directory/to/copy user@system:/tmp

scp -r /directory/to/copy user@system:/tmp

If the user can't write to the directory, assuming it's /tmp, you can create a directory for the user in /tmp with (althout /tmp is normally world writable but in case it isn't for some reason on your system):

mkdir /tmp/directory

And then give write permissions by making the user the owner:

chown username /tmp/directory

After that, the you can use the rsync or scp commands above.

Nasir Riley
  • 11,422
  • Thanks, Nasir. The folder is located on my desktop within a folder e.g. desktop/configuration - base. so the path would be something like this: sudo scp -r /desktop/configuration - base/ user@system:/tmp. is that correct? – itsmevic Aug 18 '19 at 15:28
  • @itsmevic Yes. You need to put quotes around the folder that you are copying because it has spaces. sudo scp -r "/desktop/configuration - base/<folder name with files>" user@system:/tmp. – Nasir Riley Aug 18 '19 at 16:16