Added ssh, and a lot of extra code to make it work