title: Python calling subprocess of a bash script in sudo
body: <p>I'm running a python script on my rPi. I have to run it in sudo to use the rpi.gpio library, but when I do, it won't let me run my bash script in non-sudo. This causes my ssh commands to prompt for passwords, even though the key-gen authentication is set. </p>
  
  <p>I'm sure I'm missing something simple. Can anyone help?</p>
  
  <p>Running python script:</p>
  
  <pre><code>sudo python ./runcam.py
  </code></pre>
  
  <p>In the py script I'm running this:</p>
  
  <pre><code>subprocess.call("./runit", shell=True)
  </code></pre>
  
  <p>And my ssh script:</p>
  
  <pre><code>#!/bin/bash
  
        FNAME=`date +'%H-%M-%S-%m%d%Y'`
  
        ssh pi@192.168.0.8 '
          mkdir $FNAME
        ' &amp; 
  
        ssh pi@192.168.0.9 '
          mkdir $FNAME
        ' &amp; 
  </code></pre>