Added check for ssh connection and remote source directory