2

I'm using a Raspberry Pi 3 running Raspbian. All I have available is an RS-232 port through an USB adapter to my PC running Ubuntu 16.04.

Is it possible to establish an SSH connection using the RS-232 wire?

  • Do you need to set up SSH or are you just looking for a way to connect the Pi? As noted below you could run PPP over the serial link if you need a network connection to the Pi and can't use Ethernet or WiFi. – dlu Apr 3 '18 at 17:49
2

You could, but it would be a fair bit of work to set up – so for initial setup it probably isn't an option unless you put together a custom image. Usually, ssh is used to secure a network login session. Over a local serial (RS-232) connection all you need is your USB serial cable (wired as a "null modem" cable) and your favorite terminal emulator.

However if you want/need a network between the Pi and the Linux machine you could set it up to run PPP over the serial RS-232 link. Then you could run ssh or any other network traffic across the link.

  • 2
    Well, the OP could run PPP over RS232, then SSH through the PPP network interface. – Janka Apr 3 '18 at 17:32
  • 1
    True enough! I suppose the question is one of "do I need to" vs. "can I." – dlu Apr 3 '18 at 17:44
  • Seems to be a bit complicated. At first I thought it is not possible, since for ssh the Raspberry needs to acquire an IP address which can't be done using the Pins (By default used as input for sensors ... generally for data transfer and not for connectivity), well thanks for the idea of PPP. – Ahmed Apr 4 '18 at 7:34
0

No - by that I mean it's impractical and there is little or no "value" in doing so. It's a dedicated, physical connection, and therefore far more secure than SSH.

What you seem to want is to run a console over a serial port, and "talk" to your Rpi3 without a network connection. If that's what you want, then you can establish communications between your RPi3 and your Ubuntu box. You state that you have a "USB adapter", but don't say how you plan on making the physical connection to the GPIO pins in the RPi3. I'll assume you're using a cable like this one from the pimoroni shop. Once you get it wired up properly, you'll need to make sure that the file on your microSD card "/boot/config.txt" does not contain the line: "enable_uart=0". If it does, then delete that line.

  • Actually the serial port is very likely RS-232 (more or less, the voltages are probably not to spec) and you can run ssh over it - think of the RS-232 as the link layer with SLIP or PPP running on top of it as the transport and ssh running on that. – dlu Apr 4 '18 at 4:30
  • I am using the same wire you mentioned. Actually what I wanted to do is send files through ssh connection, not only monitor the Rpi3 from my PC (which can be done using minicom). – Ahmed Apr 4 '18 at 7:28
  • @dlu: You're technically correct of course, and perhaps I assumed too much. That said, providing an answer to the OP that took him down that route might be considered... I don't know - "bad advice" maybe? – Seamus Apr 5 '18 at 13:05
  • Minicom has a "kermit" mode, which allows sending and reading files. – Janka Apr 5 '18 at 13:08
  • @Ahmed: Sending files, eh? That's an important clarification :) You can indeed send files over a serial port connection! In fact, that's now officially classified as "old school" :) minicom is a good choice for doing just that - or kermit. You'll need an app (rz/sz?) on both sides to accomplish this, but SSH is not that app. There's another thread here that discusses file transfer over a serial port. Good luck, and let us know how you get on! – Seamus Apr 5 '18 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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