Michael Torrie's Personal Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

computer_stuff:shareterm [2010/06/03 15:32]
Michael Torrie
computer_stuff:shareterm [2010/12/13 17:07] (current)
Michael Torrie
Line 2: Line 2:
  
 ===== Why shareterm? ===== ===== Why shareterm? =====
-On several occasions I've wished for a way to share a terminal in a manner similar to vncviewer'​s ''​--listen''​ mode.  shareterm is a set of scripts that use tmux and socat to do just that.  This has several advantages over other methods of sharing a terminal (such as ssh and tunnelling games):+On several occasions I've wished for a way to share a terminal in a manner similar to [[http://​www.tightvnc.com/​vncviewer.1.php|vncviewer'​s ''​--listen''​]] mode.  shareterm is a set of scripts that use [[http://tmux.sourceforge.net/​|tmux]] ​and [[http://​www.dest-unreach.org/​socat/​|socat]] to do just that.  This has several advantages over other methods of sharing a terminal (such as ssh and tunnelling games):
   * remote host operator needs no login information   * remote host operator needs no login information
   * minimal software requirements   * minimal software requirements
-    * server (remote host receiving the terminal session) needs only python, socat, openssl, an ssl   key and cert +    * server (remote host receiving the terminal session) needs only python, ​[[http://​www.dest-unreach.org/​socat/|socat]], openssl, an ssl   key and cert 
-    * client (local host sending the terminal session) needs only bash, socat, openssl, tmux, and an optional certificate authority file.+    * client (local host sending the terminal session) needs only bash, [[http://​www.dest-unreach.org/​socat/|socat]], openssl, ​[[http://​tmux.sourceforge.net/​|tmux]], and an optional certificate authority file.
   * Host sharing the terminal can be behind a firewall on a private network   * Host sharing the terminal can be behind a firewall on a private network
   * Access to the shared terminal and the computers being worked on can be controlled and monitored by a local admin.   * Access to the shared terminal and the computers being worked on can be controlled and monitored by a local admin.
Line 37: Line 37:
 shareterm.sh -c /​path/​to/​cacert.crt <​remotehost>​ <​remoteport>​ shareterm.sh -c /​path/​to/​cacert.crt <​remotehost>​ <​remoteport>​
 </​code>​ </​code>​
 +
 +Once the terminal is shared, the local user and the remote user will both be connected to the same tmux session. ​ Please see the tmux manual for the keystrokes to operate tmux.  If you've ever used Screen before, the commands are very similar, but tmux uses ^B as the default command key, rather than ^A.  tmux allows multiple screens (similar to virtual terminals) to be created, and switch between them.  Both the local and remote user will always see the same virtual screen, so if the local user switches to screen 1, the remote user will be switched as well.
  
 ===== The Scripts ===== ===== The Scripts =====
Line 46: Line 48:
  
 Note that there is absolutely no good reason for the shareterm-listen script to be written in Python. ​ I mainly did it because there are slightly more command line arguments available in that script and Python'​s optparse module beats Bash's getopt by a large margin. ​ But in reality both scripts could have been written in plain Bash (or even sh). Note that there is absolutely no good reason for the shareterm-listen script to be written in Python. ​ I mainly did it because there are slightly more command line arguments available in that script and Python'​s optparse module beats Bash's getopt by a large margin. ​ But in reality both scripts could have been written in plain Bash (or even sh).
 +===== ChangeLog =====
 +  * 2010-12-13 ​ Michael Torrie ​ <​torriem@gmail.com>​
 +    * shareterm.sh:​ Finally fixed PSALL so it really works. ​ Before it always returned an error that was simply ignored. ​ Now it properly executes whatever is in PSALL. ​ Set version to 1.2 in shareterm.sh
 +  * 2010-06-12 ​ Michael Torrie ​ <​torriem@gmail.com>​
 +    * shareterm.sh:​ Clean up old tmux clients still attached to our session before starting a new client to send to remote host
 +    * shareterm.sh:​ If local side disconnects while remote host still attached, give warning and option to reattach or terminate the session.
 +

QR Code
QR Code computer_stuff:shareterm (generated for current page)