14

I have connected to my Ubuntu box using its serial port on windows(using putty connection is working fine.)

According to the question https://serverfault.com/questions/892892/how-to-use-ssh-over-serial-without-using-pppd-or-how-to-transfer-tcp-over-ser, it appears I should be able to SSH into the machine over a serial port.

What packages are needed or alternatively how do I set this up?

http://patrickst.blogspot.com/2011/11/tcpip-over-slip-on-gnulinux-ubuntu.html

https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-mac-and-linux

9
  • @user68186 except I'm not transfering data but I want a shell.
    – William
    Sep 14, 2018 at 16:41
  • @user68186 Both do not have ethernet. A crossover cable has been eliminated do to other technical reasons.
    – William
    Sep 14, 2018 at 16:47
  • You'd need to have TCP/IP over serial Sep 17, 2018 at 8:02
  • @William what do you mean by "putty connection is working fine", If you are unable to ssh into it. Sep 20, 2018 at 21:00
  • @PrathuBaronia it just spits back machine info
    – William
    Sep 20, 2018 at 21:02

3 Answers 3

1

SSH is meant to accept (secure) connections over TCP/IP. To use SSH over a serial port, you'd need something acting as a TCP client and "forwarding" data from/to the serial port, such as socat.

This (source) should be enough, assuming /dev/ttyS1 is your serial port, 115200 is the desired baud rate ("Speed" when using PuTTY for Serial connection) and you have sshd listening on port 22 (which is the default):

socat -d -d tcp:127.0.0.1:22 file:/dev/ttyS1,b115200

-d -d, according to the manual:

Prints fatal, error, warning, and notice messages.

I have not tested this, as I do not have a serial port at the moment.

If you just need login and run shell commands over the serial port, you can run getty, agetty or even screen on a serial port. The SerialConsoleHowto guide is outdated, but this answer might help.

0

Okay, why do you need ssh, when you are on the shell in the serial port? Normally, you use the serial port, because, you want to see the device output and access its shell, and you use ssh when the machine is far, far away from you physically. If you still want, please go ahead and connect a RJ45 cable from the device to the computer where SSH is installed. I am assuming, you have set up proper IP networking and installed SSH server. Because, SSH works over the TCP on port 22. And in doing so, you are going to miss some serial output, because, SSH (Secure Shell) only gives you a sell. Use both and know the difference. Hope that helps!

-3
  1. Download putty.exe from here.
  2. You should know the number of COM port and the baud rate of the port.
    • If you don't know both, try to fix speed at 115200 then try COM1 to COM8.
  3. Start putty.exe
    • Choose "Serial" in "Connection type"
    • Set baud rate in "Speed"
    • Set COM port name in "Serial line"
    • Press "Open"

Putty

2
  • On Ubuntu box also install and configure openssh package. Should be running on same tty as you have serial connection. Look in dmesg for the tty number then put it in your openssh configuration.
    – kukulo
    Sep 15, 2018 at 12:21
  • Yes this is how I am connected to the device using serial but unfortunately by default serial doesn't support sshing into the machine.
    – William
    Sep 15, 2018 at 15:35

You must log in to answer this question.

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