2

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
1
  • Does you use DHCP? What model is your router?
    – D'Arvit
    Jun 29, 2010 at 18:56

2 Answers 2

3

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.

1
  • +1 ip addr is easy, this is the first I've heard of it.
    – Mitch
    Jun 29, 2010 at 19:10
4

To get the ip of computer1 if you have access to computer1 type this: ifconfig

Assuming you have SSHD running on both machines, I would use SCP or rsync over ftp. for scp the command is simply

scp /path/to/file username@ipremotemachine:/path/to/copy/to

And for rsync

rsync /path/to/file ipremotemachine:/path/to/copy

But since you asked about ftp simply type:

ftp remoteip

It will ask for username password, then you have to use the ftp client.

man ftp

will give you more information. But honestly If you are doing simple file moves I would highly recommend scp, or rsync.

6
  • 2
    sftp is probably available too. Just like FTP, only pushed through SSH connection Jun 29, 2010 at 18:50
  • Thanks, but first i need to find computer1 ip.I have to do that with ftp or sftp
    – Ben
    Jun 29, 2010 at 18:54
  • 1
    @meyosef: You can't find the IP of computer1 using ftp, because ftp requires the IP of the destination computer to use it. If you can type commands on computer1, you can find the IP by typing the command ifconfig
    – Jarvin
    Jun 29, 2010 at 18:58
  • @Mitch: I'd recommend changing ifconfig eth1 to just ifconfig (or ip addr works too) because we don't know what interface is exposed on meyosef's computers. (but +1 anyway)
    – David Z
    Jun 29, 2010 at 19:07
  • How I can find computer1 ip only with computer2 when i know that exist only 2computers? (I want to get all host when computer2 ip i simply find with ifconfig )
    – Ben
    Jun 29, 2010 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .