Sunday, 15 May 2016

Minicom for serial console connections

Mini ...what?

Every now and again  I fail to ssh to various device that being a server, firewall box or a random router. The only option at this time is to get physical access to the box and plug my trusty serial pl2303 connector.
At work is straightforward as I use putty on Windows box, but at home I use Ubuntu so the only option that I know of is to use a utility call minicom.
I keep forgeting how to do it as don't have to do it very often  so here's my reminder.

  • Install Minicom
      • sudo apt-get install minicom
  • Find out which connection is being used by your serial cable by executing  the command below
      • george@uc:~$ dmesg  | grep tt
      • [    0.000000] Found optimal setting for mtrr clean up
        [    0.000000] console [tty0] enabled
        [    0.212709] vgaarb: setting as boot device: PCI:0000:00:02.0
        [    0.641198] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input1
        [    0.641202] ACPI: Power Button [PBTN]
        [    0.641244] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input2
        [    0.641247] ACPI: Sleep Button [SBTN]
        [    0.641288] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
        [    0.641291] ACPI: Power Button [PWRF]
        [    0.654926] ACPI: Battery Slot [BAT0] (battery present)
        [    0.697515] evm: HMAC attrs: 0x1
        [    0.698208] rtc_cmos 00:02: setting system clock to 2016-05-14 21:26:40 UTC (1463261200)
        [    0.988132] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giomtti <giometti@linux.it>
        [    1.030838] tg3 0000:0a:00.0 eth0: attached PHY is 5761 (10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[0])
        [    1.373946] sd 0:0:0:0: Attached scsi generic sg0 type 0
        [    1.416301] sd 0:0:0:0: [sda] Attached SCSI disk
        [    1.734473] sr 1:0:0:0: Attached scsi CD-ROM sr0
        [    1.734574] sr 1:0:0:0: Attached scsi generic sg1 type 5
        [    7.568508] systemd[1]: Created slice system-getty.slice.
        [    7.568525] systemd[1]: Starting system-getty.slice.
        [ 1559.436187] usb 2-1.3: pl2303 converter now attached to ttyUSB0
        [ 1626.066967] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
        [ 1629.436887] usb 2-1.4: pl2303 converter now attached to ttyUSB0
        [ 1788.507218] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
        [ 1791.877138] usb 2-1.4: pl2303 converter now attached to ttyUSB0
        [ 2373.961110] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
        [ 2376.303718] usb 2-1.4: pl2303 converter now attached to ttyUSB0
        [ 2517.698598] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
        [ 2523.630796] usb 2-1.3: pl2303 converter now attached to ttyUSB0
  • From the output above I can see that my cable is attached to ttyUSB0 
  • It's time to configure Minicom
      • george@uc:~$ sudo minicom -s -c on
    • You should now see the config window as below


  • Select the Serial port setup and press A to change the port
    • Now this will depend on individual set up but in my case I need to change the port to /dev/ttyUSB0
  • Select E and change the baud rate to 9600


  • Save the setup as DFL and exit minicom
  • Now run 
    • sudo minicom
  • You should now be able to connect to your device if you press the spacebar a couple of times 
  • I just tried it with putty on my Ubuntu box and it worked as well as with minicom , some of you may find it a bit more intuitive by using putty


Now what was the password for that box ????



No comments:

Post a Comment