Configure a Cisco Switch via Linux With Screen

I needed to configure a cisco switch, but I don’t have a COM port on my laptop. Fortunately I had a USB to serial convertor. When I tried connecting my Linux system to the switch using screen (screen /dev/tty.usbserial), I got the following errors:

Cannot open line '/dev/tty.usbserial' for R/W: Resource busy
Sorry, could not find a PTY.

I could find a lot of information on the web that involved changing permissions on certain files. I tried that but it didn’t fix the problem. So I fiddled around a bit and found quite fast the cause of these errors. Apparently the screen process was already running, because I launched it before I installed the driver for the convertor. First, find the PID of the running process:

ps ax|grep -i screen
1093 .usb  Ss+    0:00.02 SCREEN /dev/tty.usbserial

Next, kill it:

sudo kill 1093

Try to invoke the command again. It should work now!