Smarter SSH functions