Use Linux Screen for Console Access

When you use Linux there’s no need to use Minicom or Putty for console access. You can also use screen for direct console access, here’s how to do it:

$ sudo screen /dev/ttyUSB0

Just use the screen command and specify your device. In my example I’m using a USB to Serial adapter. You’ll find yourself at the console, I’m using a Cisco router here:

Router# 

If you want to scroll up you’ll need to hit CTRL-A and then hit the [ button. You’ll see something like this:

Copy mode - Colum 8 Line 49(+1024) (190,49)

You can now use the page up / down or the arrow buttons to scroll up and down. Hit the ESC button to return to console access.

Cisco engineers might need the break function to access rommon. CTRL + BREAK won’t work but there is another method in screen. Do a CTRL-A and then CTRL-B to send a break. You can hit CTRL-B a couple of times to send multiple breaks.

Once you are done at the console you do CTRL-A and then K to exit your console session.

That’s all there is to it, I hope this is useful for you!

Tags:


Forum Replies

  1. Hi Mario,

    Thanks, I might do it in the future but first I have plenty of Cisco material I want to write about :slight_smile:

    Rene

  2. Hi Rene,

    Do you know how in linux is possible to save the output from the console to a file.txt?

    Thanks

  3. Hello Giovanni

    In Linux, the command script will do what you are asking for. Take a look at the man page for this command.

    In short, you can type script output.txt and all subsequent commands and output will be saved to the output.txt file. Here is an example of the commands you can use:

    $ script output.txt
    Script started, file is output.txt
    
    $ ls
    output.txt  testfile.txt  foo.txt
    
    $ exit
    exit
    Script done, file is output.txt
    

    You can then read the output.txt file which will have all of the CLI commands and outputs you saw on the terminal.

    I hope this has been helpful!

    Laz

  4. Ok I think I solved.

    Don’t know why but my Ubuntu not mount /Dev/ttyUSB0 when I plug the console cable.

    I’m not sure what is changed but now IF I try to force the connection ( without TAB ) it is correctly mounted and works

3 more replies! Ask a question or join the discussion by visiting our Community Forum