xavier666
Posts: 4
Joined: Mon Jul 03, 2017 10:50 pm

Control Linux PC by connecting a Pi to it via USB

Mon Jul 03, 2017 11:06 pm

I have a PC A whose eth0 port is already in use inside a private topology which does not have access to the Internet.
It does not have any Wifi interfaces also
What I want to do is to connect a Pi P to A via USB.
Then, using my controller PC B, I want to ssh to P. From P, I want to control A by using ssh over USB.
I have seen that the reverse is possible

Code: Select all

 [eth]         [ssh over USB]
B ----------> P ----------> A 
Is this possible?

itimpi
Posts: 1090
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 4:46 am

You do not mention what model of Pi?

For this to work you are going to need the Pi to be able to drive the USB port in ‘gadget’ mode. As far as I know only the pi0, Pi0W and Pi model A can do this.

User avatar
rpdom
Posts: 15410
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 5:08 am

itimpi wrote:For this to work you are going to need the Pi to be able to drive the USB port in ‘gadget’ mode. As far as I know only the pi0, Pi0W and Pi model A can do this.
It won't work with either of those because they don't have an ethernet connection, and you can't add a USB ethernet dongle when in gadget mode.

It could possibly be done with a Pi B/B+/2B/3B and a USB-net cable.

fruitoftheloom
Posts: 20921
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 5:22 am

USB-NET Cable may be the answer, see: viewtopic.php?f=36&t=131042
Retired disgracefully.....

ghans
Posts: 7876
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 7:28 am

There are WiFi shields for the Pi0 based on SPI and the ESP8266. Not fast , but they work.

ghqns
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
B.Goode
Posts: 8878
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 7:29 am

Why not simply connect all 3 devices to the same shared private network infrastructure?

Or is there an implication that controller PC B is outside of the private network?

xavier666
Posts: 4
Joined: Mon Jul 03, 2017 10:50 pm

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 11:09 am

itimpi wrote:You do not mention what model of Pi?

For this to work you are going to need the Pi to be able to drive the USB port in ‘gadget’ mode. As far as I know only the pi0, Pi0W and Pi model A can do this.
RPi 3 Model B

xavier666
Posts: 4
Joined: Mon Jul 03, 2017 10:50 pm

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 11:11 am

B.Goode wrote:Why not simply connect all 3 devices to the same shared private network infrastructure?

Or is there an implication that controller PC B is outside of the private network?
You are indeed correct. Controller B is outside the private network.

I can, however, connect to the Pi via wlan. Using wlan, I want to ssh into the Pi, through which, I want to ssh to PC A

fruitoftheloom
Posts: 20921
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 11:15 am

xavier666 wrote:
itimpi wrote:You do not mention what model of Pi?

For this to work you are going to need the Pi to be able to drive the USB port in ‘gadget’ mode. As far as I know only the pi0, Pi0W and Pi model A can do this.
RPi 3 Model B
The RPi 3B does not support USB "Slave" Mode it is a hardware limitation.

If you can not use WiFi, Ethernet or Bluetooth then as I linked above USBNET Cable.
Retired disgracefully.....

User avatar
B.Goode
Posts: 8878
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 11:15 am

Can you make a cabled Ethernet connection from Pi P to the private network?

xavier666
Posts: 4
Joined: Mon Jul 03, 2017 10:50 pm

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 11:21 am

fruitoftheloom wrote:
xavier666 wrote:
itimpi wrote:You do not mention what model of Pi?

For this to work you are going to need the Pi to be able to drive the USB port in ‘gadget’ mode. As far as I know only the pi0, Pi0W and Pi model A can do this.
RPi 3 Model B
The RPi 3B does not support USB "Slave" Mode it is a hardware limitation.

If you can not use WiFi, Ethernet or Bluetooth then as I linked above USBNET Cable.
Ok thanks!

User avatar
DougieLawson
Posts: 36321
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 5:36 pm

ghans wrote:There are WiFi shields for the Pi0 based on SPI and the ESP8266. Not fast , but they work.

ghans
What's slow about this one https://redbear.cc/content/blog/pi-zero-iot-hat/ ? Got one of those on my RPi2B, it fits a Zero.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

pcmanbob
Posts: 7100
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Control Linux PC by connecting a Pi to it via USB

Tue Jul 04, 2017 6:58 pm

Breaching a private network like this and allowing access from the internet is risky and in a work or education environment could get you in a lot of trouble with the system administrator.

You have been warned your job / university place could be at risk here if this is not your own network
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Advanced users”