Close SSH session in remote Run function