惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
G
Google Developers Blog
人人都是产品经理
人人都是产品经理
U
Unit 42
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
B
Blog RSS Feed
The Cloudflare Blog
D
Docker
A
About on SuperTechFans
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
月光博客
月光博客
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
博客园_首页
Stack Overflow Blog
Stack Overflow Blog

Ittavern.com

Wimage - Hosting Open-Source Image Uploader with Podman and external S3 Storage Switching from Hugo to picopaper Encryption using SSH Keys with age in Linux ETag in nginx - Simple Resource Caching Sending nginx Logs to Loki with Grafana Alloy How to: Cisco ISE backup to SFTP repository with public key authentication Dummy IP & MAC Addresses for Documentation & Sanitization Deploying ISSO Commenting System for Static Content using Docker Generate a Vanity v3 Hidden Service Onion Address with mkp224o ssh-audit Primer - Audit your SSH Server mtr - More Detailed Traceroute - Network Troubleshooting My Personal Backup Strategy - August 2024 iperf3 - User Authentication with Password and RSA Public Keypair Adding a trash can to Linux with trash-cli Bandwidth Measurement using netcat on Linux Getting started with rsync - Comprehensive Guide Cron Jobs on Linux - Comprehensive Guide with Examples SSH Server Hardening Guide v2 Port Knocking with knockd and Linux - Server Hardening Getting started with rclone - Data transmission Getting started with dig - DNS troubleshooting Getting started with Fail2Ban on Linux Getting started with netcat on Linux with examples URL explained - The Fundamentals Troubleshooting Asking The Right Questions Create tmux layouts using bash scripts Getting started with tcpdump - Ittavern.com Curl on Linux - Reference Guide Getting started with nmap scripts My Offsite Backup - March 2023
Linux - connect to a serial port with screen
2022-12-09 · via Ittavern.com

There are a bunch of programs out there, that can get you connected to a serial port of a switch, but using screen was the best and easiest solution I've found. Works perfectly in the CLI, can be run in the background, and easy to set up - if it is not already installed.

It worked with various combinations of serial-to-usb-cables, Cisco switches, and Linux machines. Let us start with the command itself:

  • sudo screen /dev/ttyUSB0 9600
    • sudo screen - run screen as sudo
    • /dev/ttyUSB0 - the tty number of the usb cable / adapter
    • 9600 - the speed of the serial connection

You can kill the session with CTRL + a, then k, and confirm it with y.

Finding the device / the tty number #

Find the tty number while you are already connected:

sudo dmesg | grep tty

Output:

kuser@pleasejustwork:~$ sudo dmesg | grep tty
[    0.134050] printk: console [tty0] enabled
[1724834.635665] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0

Shows the device while plugging it in:

sudo dmesg -wH | grep tty

Output:

kuser@pleasejustwork:~$ sudo dmesg -wH | grep tty
[sudo] password for kuser: 
[  +0,000022] printk: console [tty0] enabled
[  +0,001283] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0

This is helpful if you are connected to multiple devices.

Finding the correct speed #

I haven't had to change this yet, but just in case:

sudo stty -F /dev/ttyUSB0

Output:

kuser@pleasejustwork:~$ sudo stty -F /dev/ttyUSB0
speed 9600 baud; line = 0;
-brkint -imaxbel