1

Is it possible to plug a USB-to-Ethernet adapter into a Raspberry Pi's Ethernet port and the USB end into a laptop's USB cord to immediately share Internet connection with the Pi? My laptops don't have Ethernet ports and I'd like to ssh into raspberrypi.local without the Pi having to be set up to connect to the same network as the laptop. Plus, I'd like if I don't need to set up any configuration to share the connection (So I could ssh into the Pi right upon plugging it into a laptop.).

I was thinking of an adapter like this with an Ethernet cable plugged into the port on the adapter:

enter image description here

1
  • You provide minimal information - like what OS is on your laptop. NOTE You can have ICS OR ssh access to the Pi, NOT BOTH.
    – Milliways
    Mar 14, 2017 at 1:41

2 Answers 2

0

Yes, that should work. You need 1 ethernet port on your Raspberry Pi and 1 ethernet port on your PC to connect your Raspberry Pi to your laptop. You can use a USB to ethernet cord when you don't have an ethernet port available.

  • If you have a Raspberry Pi 3 B and a laptop with an available ethernet port, just connect those with an ethernet cord, no need for USB to ethernet cords.
  • If you have a Raspberry Pi without an ethernet port and a laptop with an available ethernet port, you need 1 USB to ethernet cord for the Raspberry Pi.
  • If you have a Raspberry Pi without an ethernet port and a laptop without an available ethernet port, you need 2 USB to ethernet cords, 1 for the Raspberry Pi and 1 for the laptop.

To set up SSH on a fresh install of Raspbian:

  • Use a keyboard and display, run sudo raspi-config and set up SSH from there.
  • Alternative method (when you have no keyboard or display): make a file called ssh in the /boot/ directory of Raspbian before you boot your Raspberry Pi.

I should also mention that some people are using SSH over USB for the Raspberry Pi Zero (without using WiFi or ethernet). This is done by enabling "gadget mode" on the Raspberry Pi Zero, allowing the Raspberry Pi Zero to become both host/slave over USB.

4
  • Are there any USB-to-Ethernet adapters for the laptop? I am planning to use this as a portable Linux system with internet...
    – anonymous
    Mar 14, 2017 at 16:23
  • Ofcourse there are, you even posted a picture of one in your question.
    – Max
    Mar 15, 2017 at 8:29
  • Would I need 2?
    – anonymous
    Mar 16, 2017 at 11:52
  • I edited my question. It depends on your available network ports.
    – Max
    Mar 17, 2017 at 11:02
0

That should work granted you don't need internet, like the other answer above you need to enable ssh. If using the raspberry pi imager you can setup a domain and enable ssh without ever stepping foot in the Raspberry Pi os. Keep in mind that you will need to download Apple's Bonjour print service, and that if you want to use a command like:

sudo apt update

You will need an internet connection. If you are using Windows you can go into your network adapter settings, then go into the settings for your wifi adapter, then select share network connection and choose the USB Ethernet port. You should now have internet on your raspberry pi while being directly connected to your computer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.