another conversion of http://hub.darcs.net/simon/ssh