![]() | |||||||||
|
|
|
How can I efficiently log into all 8/16/48 serial ports via SSH? It is recommended that SSH is used as the security protocol when remotely connecting to serial port consoles attached to the console server. However there is a resource limit on the number of concurrent SSH sessions that can be open at the one time (50 for CM41xx, IM42xx or IMG console servers and 10 for CM/SD4001/8 console severs). To overcome this limit OpenSSH provides a "ControlMaster" connection facility which can be shared with other SSH sessions through a UNIX socket. This is similar to forwarding X11 or arbitrary TCP ports over the same connection, except that each Master SSH is restricted to 10 shell sessions. When the ControlMaster connection is established with the console server it goes through the normal login sequence, including asking for passwords and exchanging keys. However subsequent SSH sessions you initiate to the same console server may connect to the ControlMaster via the UNIX domain socket. The master SSH session then creates another interactive connection within the existing session, which your second SSH uses. Because the existing session is re-used, the connection setup is very much faster. There is no need to pull up a new TCP/IP connection, no need for key exchange, and no need for authentication. An example which establishes two connections to each of 8 serial ports on a CM4008 is as follows: #!/bin/bash # Our two unix sockets: CONN1="ssh -o ControlPath=~/cm4008" CONN2="ssh -o ControlPath=~/cm4008-2" # Set up two connections, without actually establishing # a login session, and background after negotiating # the connection ${CONN1} -o ControlMaster=yes -N -f user@cm4008 ${CONN2} -o ControlMaster=yes -N -f user@cm4008 # Using the first Master, connect to the CM4008 and # connect to each of the 8 ports xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port01 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port02 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port03 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port04 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port05 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port06 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port07 & xterm -e ${CONN1} user@cm4008 pmshell -l /dev/port08 & # Using the second Master, connect to the CM4008 and # connect to each of the 8 ports xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port01 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port02 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port03 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port04 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port05 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port06 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port07 & xterm -e ${CONN2} user@cm4008 pmshell -l /dev/port08 & Another alternative is to use the SDT Connector client to access the console server. SDT Connector will establish only the one secure SSH tunnel to the console server and secured Telnet connections to multiple serial ports (and VNC/RDP/HTTP connections to hosts) can then be set up through that one SSH port. For details refer faq238 |
| © Opengear 2010| Privacy Policy |