Raspberry Pi Term Server

So I got this idea online to make my own terminal server with a Raspberry Pi and ser2net.

20180301_151019

Hardware needed.

  • UGREEN USB to Serial RS232 Cable Adapter 4 Ports DB9 Converter 9-Pin Male to Male with Hexnuts
  • Raspberry Pi

Software installed.

  • Raspbian Stretch Lite I’m running this on Buster now
  • Ser2net
  • UFW
  • Screen

I think a Pi Zero could also do the job and save a few dollars. So far it remembers the port numbers on reboot and my config is good but I’m working on getting the logging to work the way I want it.

Install ser2net running Raspbian Stretch:

apt-get install ser2net  Then edit /etc/ser2net.conf with your USB to information that I got from running “dmesg | grep tty”.

[ 4.518967] usb 1-1.5.1: pl2303 converter now attached to ttyUSB0
[ 4.523283] usb 1-1.5.2: pl2303 converter now attached to ttyUSB1
[ 4.535015] usb 1-1.5.3: pl2303 converter now attached to ttyUSB2
[ 4.539260] usb 1-1.5.4: pl2303 converter now attached to ttyUSB3

And my ser2net.conf looks like this.

2000:telnet:600:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT banner
2001:telnet:600:/dev/ttyUSB1:9600 8DATABITS NONE 1STOPBIT banner
2002:telnet:600:/dev/ttyUSB2:9600 8DATABITS NONE 1STOPBIT banner
2003:telnet:600:/dev/ttyUSB3:9600 8DATABITS NONE 1STOPBIT banner

<TCP port>:<state>:<timeout>:<device>:<options>

apt-get install ufw

sudo ufw default deny

sudo ufw allow ssh

sudo ufw enable

sudo ufw status numbered

Installed screen:

sudo apt-get install screen

screen -S term <to open a screen with the name term>

To use the terminal server I ssh in and then run screen and open a terminal in there. The advantage to that is I can leave the terminal running during an upgrade and go get some milk and cookies.

telnet 127.0.0.1 2001

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.