2

Let's say I have 2 pc's set up on a wireless network.

Machine A is my daily driver and it uses Ubuntu 15.04 Machine B is an old pc I want to set up as an ssh server with Debian LXDE(but it boots to terminal).

How do I copy files from machine A to machine B.

muru
  • 193,181
  • 53
  • 473
  • 722
Mario Kamenjak
  • 1,023
  • 2
  • 16
  • 25
  • If you want two-way communication then install `open-ssh server` on both..`openssh-client` is installed by default..the use `scp`, or `rsync` or plain `ssh`.. – heemayl Jul 09 '15 at 15:25
  • yeah but aside from the installation what are the actual commands for file transfer, which method is the best/easiest? – Mario Kamenjak Jul 09 '15 at 15:29
  • I suggest you look at *[How to setup a restricted SFTP server on Ubuntu?](http://askubuntu.com/q/420652/40581)* it has more details than you asked for but it also explains how to connect via GUI and make the setup more secure. – LiveWireBT Jul 10 '15 at 21:43

2 Answers2

8

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

muru
  • 193,181
  • 53
  • 473
  • 722
Ron
  • 20,518
  • 6
  • 57
  • 72
2

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
Mike
  • 5,551
  • 10
  • 39
  • 60