copy files over ssh

You can use scp as in:

scp <file> <username>@<IP address or hostname>:<Destination>

In addition, with the -r flag, you can recursively copy files.

You can also use rsync which can resume transfers if the connection breaks, and it intelligently transfers only the differences between files:

rsync -avz -e 'ssh' /path/to/local/dir user@remotehost:/path/to/remote/dir
  • -a archive

  • -v verbose

  • -z compress

  • -e ssh "use a SSH tunnel"

Refer:

  1. https://help.ubuntu.com/community/SSH/TransferFiles

  2. How to use ssh to transfer files from computer a to local computer


If you prefer GUI you can also install openssh-server on machine B, it can be setup from terminal, and use FileZilla on machine A to connect to machine B. FileZilla will allow you to visually explore file structure, browse directories, copy, move files and directories and it supports login with keys without passwords.

To install openssh-server

sudo apt-get install openssh-server

To install FileZilla

sudo apt-get install filezilla