Updated SSH connection function