I am trying to SSH into my Raspberry Pi 3 Model B V1.2 from my laptop running CentOS7. I have connected them together via Ethernet cable but the laptop is unable to identify Raspi. So i tried running the following command provided by a user in a similar question on StackExchange:

$cat /proc/net/arp
IP address       HW type     Flags       HW address            Mask     Device

Also i tried scanning using nmap using this command found while searching StackExchange:

Starting Nmap 7.70 ( https://nmap.org ) at XXXX-XX-XX XX:XX XXX
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers
Nmap done: 20 IP addresses (0 hosts up) scanned in 0.04 seconds


  • I don't have an external display with HDMI input port.
  • I don't have a router.

Edit: So far i have tried two things.

  • I tried assigning IP address to my Raspi as well to my Ethernet port manually as told by a user in one of the answers.

    ssh: connect to host port 22: Connection refused

  • I tried installing dhcp server on my laptop as told by another user in the answers.

    systemctl start dhcpd
    Job for dhcpd.service failed because the control process exited with error code. See "systemctl status dhcpd.service" and "journalctl -xe" for details.

  • 1
    you should edit the question and add as an update what you did so far (mostly in the answer's comments), so that by just looking at the question alone people will be up to date to your problem
    – A.B
    Mar 20, 2019 at 18:56

4 Answers 4


Alternatively you can connect your Pi to your cell phone and USB tether it.  Here is how I would do it

Using Android from Windows:

  1. Download adb, drivers, nmap and scrcpy
  2. Connect Android via USB cable to PC
  3. Enable USB debugging (and first enable developer options, if necessary)
  4. Open command prompt
  5. Type adb devices and press the popup window on the Android screen, accepting the RSA key
  6. Type adb tcpip 5555.  This allows you to connect to the Android via TCP/IP.
  7. Make sure Android is connected to WiFi (or, alternatively, use your PC's WiFi card to make an Access Point and then connect to it via the Android WiFi controls)
  8. In command prompt, type ipconfig and find your IP address for the AP
  9. Now type nmap (your IP)/24 -p 5555 -open.  This will give you the Android's IP.
  10. Type adb connect (Android IP) 5555
  11. Type scrcpy.  Now you can see your Android's screen on your PC.  Additionally, you can use your keyboard and mouse to control your Android.  Not that this is 100% necessary, but I like doing things visually like that.
  12. Open terminal emulator OR open another command prompt and type adb shell
  13. In either method (emulator via scrcpy or shell via adb) type ifconfig
  14. Find the Android's IP and write a script to try ssh or netcat on each of the IPs until you find it (although with Android USB tethering it is likely or .100 but that IP block isn't set for tethering on every device which is why you have to find the IP address)
  15. And you are connected!

Alternatively, assuming adb is not an option, you could try installing an ssh server, termux, a VNC server, or an ssh server on Android and access the Android's USB tethering subnet this way.

If you don't want to do it this way, you could try using Wireshark or tcpdump to see if the Pi has an assigned IP.  You just have to dump your Ethernet card's packets (sudo tcpdump -i eth0) assuming eth0 is your Ethernet card. If you don't see anything with an IP in the packets then you need to use DHCP to get the Pi an assigned IP. In essence, that is why I suggested the adb method, because, when you use USB tethering, Android has a DHCP server that it uses to assign an IP to whatever the connected device is. Other things you can try is getting a USB WiFi and/or Bluetooth card for the Pi. You can also usually find a router at the Goodwill store for $2-$10 that will save you a lot of time.

Note: Honestly it has been a long time since I thought about it, and I don't know what changed or when/if it is still applicable, but back in the day, you would have to use a "crossover cable" type Ethernet cable to connect two computers directly. The difference in the crossover cable is that the two wires have different positions in a crossover cable and that does something that bypasses the need for a router. This may be the problem, but I doubt it because I think this applies only in unique situations nowadays (but as I said, I don't know what those situations encapsulate).

Anyway I hope this helps someone (even though I am a couple years late to the game).


I think you might be searching for something that doesn't exist. Your PI probably doesn't have an IP address.

These days it might actually be easier to configure your Raspberry PI's internal WIFI to connect and find it that way. If you want to do this with a direct cable then you will need to consider the following:

Your first problem might be the cable. It used to be a problem that Ethernet devices couldn't detect when they were wired PC to PC and needed a special "crossover cable" to achieve this. Switches (and routers) are wired in reverse meaning you don't need the cross over with a switch or router. Modern PCs can often auto-detect but this is not guaranteed.

Secondly without a router involved there will be no DHCP server to assign IP addresses. I believe windows would just pick an IP, but I don't believe Linux and your PI will.

Fortunately you can statically assign an IP address on both your laptop and your PI. The simplest way on your pi might be to edit /etc/network/interfaces:

auto eth0
iface eth0 inet static

I don't know centos but... This link suggests ... /etc/sysconfig/network-scripts/ifcfg-eth0:


Remember to check your LAN device name on CentOS. You should be able to do this by typing at the command line ip address. This will list a number of devices:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 11:21:07:02:2f:10 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic enp0s3
       valid_lft 83996sec preferred_lft 83996sec

In the above my network device name is enp0s3.

  • How can i access Raspi to edit etc/network/interfaces if i cannot SSH into it. Also what do you mean by LAN device name? Mar 20, 2019 at 11:56
  • How did you install the OS on the PI? If you have a linux laptop, just pop the SD card out and plug it into your laptop. Mar 20, 2019 at 11:59
  • 1
    Oh ok, so i have to change line no.3 address to a IP of my choice and in /etc/sysconfig/network-scripts/ifcfg-eth0 line no.3 to same IP address i chose for my Raspi. Please can you confirm? Mar 20, 2019 at 12:03
  • 1
    Yes, but remember to keep both devices on the same subnet. That is first three numbers the same on both devices, last number different when the subnet mask is 10.10.10.x is a good subnet to use as long as your LAN / WIFI is not on the same one. Mar 20, 2019 at 12:04
  • Also will the line no.4 remain unchanged? Mar 20, 2019 at 12:06

I am trying to SSH into my Raspberry Pi 3 Model B V1.2 from my laptop running CentOS7. I have connected them together via Ethernet cable but the laptop is unable to identify Raspi... Please suggest a method to SSH into Raspi from my laptop

So SSH is a protocol. That is a method of communication, which happens on top of the Ethernet connection... which uses TCP/IP. In other words, it sounds like your Rasb_Pi is not networking properly, and that is the problem first and foremost.

my recommedation:

  1. on rasbery pi you have no display, so i assume it comes preconfigured and is using DHCP... which is ok. What that means is when network cable is plugged in to it, it is looking for a DHCP server to get itself an IP address.
  2. to solve problem of needing a dhcp server u can plug things into a router (your home router given to you by your Internet service Provider) which will provide DHCP...
  3. or if it's just the laptop and rasb_pi connected together directly (which is perfectly fine) then you need to set up DHCP server via software in CentOS on the laptop, and that will provide the IP address to the rasb_pi when it searches for one when the network cable is plugged into it.

You might also try using software like Wireshark in Centos to scan the network when the rasb_pi is connected to laptop deduce the 169.254.x.x IP address the rasb_pi drops to when it doesn't get one via dhcp.

Only once you know the ip address of the pi can you then SSH into it... like me trying to mail you something I can't do that unless I first know your address.

  • Do you mean something like this: unix.stackexchange.com/questions/295238/… Mar 20, 2019 at 12:21
  • basically. you need to do yum install dchp-server in centos. It might just be yum install dhcp. I typically use the software gui, just search on dhcp. You will already have the dhcp-client. You need the server part of dhcp, which when installed will be a service that runs in the background dishing out IP addresses to whatever asks for one on the network
    – ron
    Mar 20, 2019 at 12:25
  • you will then need to know what address dhcp server gives to your PI before you can SSH to it, so you will need to figure out a little bit about dhcp server configuration... since it's one device edit /etc/dhcp.conf or whatever and tell it only to handle one device connection and the range of valid IP addresses will be just one IP address
    – ron
    Mar 20, 2019 at 12:29
  • might be easier to install wireshark on centos, scan, find the 169.254.?.? IP address the PI shows up as, then SSH to that.
    – ron
    Mar 20, 2019 at 12:30
  • I don't think my Raspi is assigning itself an address because here on my laptop the 'Wired connecting' is going on and on and then stops. Mar 20, 2019 at 12:35

You need that your CentOS have a dhcp server configured and running to automatically deliver an IP address to your RaspPI. After, if you do not have a switch to connect the cables, you will need to use a Ethernet Crossover Cable to connected on your CentOS Ethernet rj45 port to the RJ45 port of RaspPI. So, your RaspPI will had an IP address and your CentOS can be ping and connect to ssh (if you know the user/password)

  • I did install the dhcp server on my laptop but i was not able to configure it to provide a single IP address to the Raspi. Mar 21, 2019 at 2:34

You must log in to answer this question.

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