Abstracted the net::ssh and popen3 functions