title: Test if File/Dir exists over SSH/Sudo in Python/Bash
body: <p>I am installing certificates on a remote server and want to check whether they exist before I overwrite them. The server only allows non-root access via ssh public key. I can <code>sudo -s</code> to root once in a shell. Root is required because /etc/ssl is not readable by anyone else. This is being developed in <code>python fabric</code>, so any command that can be run in a shell command via <code>sudo</code> would work. I don't mind typing in passwords at prompts in this case.</p>
  
  <p><strong>TL;DR:</strong> I need an <code>sh</code> command that can tell my python program whether a remote file (or directory) exists when run as <code>if fabric.sudo(sh_command) == True:</code> (or something similar).</p>
  
  <p>Thank you!</p>