I'm trying to transfer some files over Ethernet and figured that conncting my headless server directly to my computer with an Ethernet cable would be the fastest method. However, things don't go quite well.

I can only acces this to server over SSH, thus requiring a connection which I first need to create myself, apparently. I have found that I need to make a connection with the option “shared to other computers.” This will then act as a router and assign IP adresses. I did this but now I dont know what IPs are used or how to find them.

The server is has FTP set up. It’s this which I want to use to transfer my files. I need an IP adress for this but don't know how to set it up over a direct connection.

Both computers run Debian and I can only acces one of them. Is there a simple solution or perhaps a better way to do this?

3 Answers 3


Figure out what IP addresses are being used.

The IP addresses assigned to all interfaces:


Or just get the IP address for one, specific interface like this:

ifconfig eth0

Will give you the assigned IP address.

Assign your own IP address.

Additional you can assign the IP address

On computer 1:

ifconfig eth0

On computer 2:

ifconfig eth0

You need to replace the eth0 with the name of your interface.

Additionally you may need to examine the firewall to make sure its isn't going to block your traffic.

iptables --list will tell you want firewall rules are being enforced.

Try using Samba.

I recommend you give up on clunky protocols, and install and configure samba on both computers. You may then simply use the cp command or etc to move files around.

Using samba you only need this on the client side:

mount  -o username=username,password=password //<ip address>/sharename /mountpoint

On the server side you need to configure the smb.conf file found either in /etc/smb.conf or /etc/samba/smb.conf

Also setup a user account

smbpasswd -a username
  • Enter password.
  • Confirm password.

Now you have valid credentials to login to the server.

Or use SCP instead.

Even scp is better idea than FTP. This uses the SSH protocol to transfer files. Follows the standard source destination format that the cp command uses.

scp root@<ip address>:/etc/ntp.conf .
  • Note that OP said ssh already works, so scp is much simpler than installing Samba, configuring it etc.
    – dirkt
    Jun 3, 2018 at 4:10
  • @dirkt Actually, I put SCP first on the list for this very reason. However, my answer was reformatted and edited. Its an edit that is trivial enough I am not going to do anything about it.
    – cybernard
    Jun 3, 2018 at 4:33
  • 1
    As I said. I can only access ssh if I have an address to connect to, but I don't have that yet. That's why I'm here. I cannot access computer 2 ....
    – KoneLinx
    Jun 3, 2018 at 12:50
  • @KoneLinx run ifconfig on both machine and it will display all ip addresses associated with the machine you run it on.
    – cybernard
    Jun 3, 2018 at 15:34

Do you have a cross in your cables?

Typical UTP Ethernet cables like a CAT6a or CAT5e Ethernet cable have ends wired to the T568A or T568B standard. With this sort of standard, each computer may transmit on one specific wire, and receive on another. If both devices on a network are sending on the same wire as each other, and trying to receive on the same wire as each other, that won't work well.

The old solution was to connect computers to hubs, and other devices like switches. These devices could use the opposite expectations, so they try to receive on the same wire that computers send, and they transmit on the wire that computers try to receive on. That works well.

A newer solution was to use a "crossover" cable, which adjusted the wiring so that one end's transmit wire corresponded to the other end's receive wire. With this setup, two computers could connect to each other and the "cross" happened in the cable itself, without the need for another device (like a hub) to perform the cross (from transmit to receive and vice versa).

Some switches may have an MDIX button so you can adjust whether one port acts like a regular computer port, or acts like a regular switch port. Pressing this button to the "inward" position results in a cross, while pressing it again causes the button to go into the "outward" position and removes the cross.

The more recent solution is heavier use of Auto-MDIX, supported by most Gigabit devices. With Auto-MDIX, network devices will perform their own little test and if they figure out that there's an issue with the transmit and receive wires not being a proper match to the remote end, one of the devices will "cross" automatically. With Auto-MDIX-capable devices, the whole concept of a required crossover becomes, effectively, a non-issue.

  • Unless you have gear that's about 10 years old or older, all network cards will have Auto-MDIX and switch, so worrying about crossover vs. straight cables isn't normally needed.
    – dirkt
    Jun 3, 2018 at 4:12
  • Erm, I see it disabled in just about every Enterprise grade interface. Not sure if it's just a distant nightmare from the past, but I have been told repeatedly by many people it fails. Gigabit cross-overs are a pain in the rear with anything past cat-5E Jun 16, 2018 at 23:43

Bit late, but if you are trying to say:

"I have PC 1, which is a normal laptop/desktop/whatever"

"I have PC 2, which is a headless, network attached server"

"I want to connect from PC 1 to PC 2, via a direct ethernet connection, but don't know what IP address is being assigned to PC 2!"

Then you should probably run a DHCP server on PC 1. I personally use DHCP Server for Windows - https://www.dhcpserver.de/cms/running_the_server/

It's a tiny portable application. It'll ask which network interface you want to use as the DHCP server (which is what hands out IP addresses), and then instruct you on what to do next. It's pretty straight forward, and only takes a couple of minutes.

Then you'll see items in the log file (which is inside the portable installation directory), which will tell you the IP address of PC 2 that's connected to PC 1.

You can then ssh root@<whatever-ip-is-reported-by-the-dhcp-server>, or ftp, or whatever you want.

PS: You can also use something like Advanced IP Scanner - https://www.advanced-ip-scanner.com - to scan for any devices in a network segment, if you don't want to dive in to the log files for whatever reason.

EDIT: Just noticed you're using Debian on both machines... https://wiki.debian.org/DHCP_Server - Is what you'll need instead.

The issue you have is that you need a DHCP server running on PC 1, to issue the IP address to PC 2. Googling that key term should throw up no end of tutorials/guides/walkthroughs.

You must log in to answer this question.

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