Linux – I have 2 computers with Linux, how can I send with ftp files from computer1 to computer2 (shell command)

ftplinuxportshell

I have 2 computers with Linux.
How can I send with ftp files from computer1 to computer2 them (shell command)?

Steps that I think should be done (miss shell commands):

  1. Find inner IP address of computer1
  2. Open the ftp port (21) of computer1 (make computer1 ftp server)
  3. Send file from computer2 to computer1 with shell command

My setup:

  1. router+modem
  2. computer1 running Linux
  3. computer2 running Linux

Best Answer

Step 1: you can type ip addr from either computer to get its IP. If they are on the same link (both inside the router) and you have avahi on both, you can refer to them as <short-hostname>.local instead of using an ip.

Step 2 is installing openssh-server on one machine, step 3 is running scp from the other. The Nautilus file manager has ssh/scp integration if you like; you can use the “connect to server” menu for that.

Another option is installing gnome-user-share on the server, configuring it from the menus or gnome-file-share-properties, and finding the server from the other computer in Nautilus's network folder.

Related Question