Posted to tcl by aspect at Wed Dec 07 04:24:53 GMT 2011view pretty
#!/usr/bin/tclsh # # edit target user's .ssh/authorized_keys to contain {command="/path/to/this.tcl"" package require Expect foreach c [split "abcdefghijklmnopqrstuvwxyz" {}] { set C [string toupper $c] lappend map $c $C $C $c } spawn /bin/bash -l interact { -re (.*) { send [string map $map $interact_out(1,string)] } }