first working version ssh; needs cleanup
further testing