3

My Linux machine has no GUI. I use it as a jump box from where I telnet/ssh on my routers to configure

The shortcut to send a process to background in Unix is Ctrl+Z On the same time the shortcut to exit the config mode for a Cisco router is also Ctrl+Z

So if you are configuring a Cisco router from the command prompt in Linux there is no way (or at least I don't know one) to send the telnet/ssh session to background so you can open a new one.

How do I fix that?

I am thinking of either changing the shortcuts or using a telnet/ssh manager that would work in text mode. Any suggestions?

2 Answers 2

4

You can change the suspend char using stty. In your case, for example, you can disable the "suspend" ability with

stty susp undef 

or change it to for example ctrl-E with

stty susp '^E' 

and you can check it:

[romano:~/Downloads/mps] % sleep 1000 
^E
[1]  + 2681 suspended  sleep 1000
1z [romano:~/Downloads/mps] 20 % fg
[1]  + 2681 continued  sleep 1000
^Z 

stty -a gives you all the special chars:

[romano:~/Downloads/mps] % stty -a
speed 38400 baud; rows 24; columns 114; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q;
stop = ^S; susp = ^E; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

... although after re-reading the question you will probably greatly benefit from a terminal multiplexer, as @Shaun suggested. My personal favorite is the good old screen, which has a lot of tutorial around, even in the written form which I prefer to videos...

3
  • I decided to reward/accept this answer as it addresses the question directly. the other answer is also good and actually that is what I needed but I poorly formulated my question. In other words, this is the solution to my question but I will use one of the utils mentioned by shaun. I would love to be able to reward both answers
    – MiniMe
    Mar 23, 2015 at 15:37
  • the funny thing is that screen has Ctrl+Z as Suspend which again conflicts with the Cisco shortcut
    – MiniMe
    Mar 23, 2015 at 16:48
  • and there is another thing that conflicts with the Cisco shortcuts: Ctrl+a which I use to get at the beginning of the line
    – MiniMe
    Mar 23, 2015 at 17:15
3

I think for your case, I'd investigate byobu/screen/tmux (I believe byobu is the go-to on ubuntu, screen is more prevalent on other linuxes, and tmux on BSDs).

A picture is worth a thousand words here, so sticking 'byobu' into youtube will explain the concept much quicker than I can in words. But they're terminal multiplexers, which allow you to start concurrent shells from within byobu, and allow you to 'tab' between them. This alone would solve your issue, but digging a little deeper into their other features may also benefit your workflow - eg, split-panes allowing you to, for example, examine running-config on two routers side-by-side, rather than flicking between them.

1
  • Thanks Shaun, I think I will try one of the above mentioned utils.
    – MiniMe
    Mar 23, 2015 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .