My .py runs a .sh which clones a git repository. I can git clone --bare ssh://mybitbucket.host/myrepo.git repo without any issues. I can also do the same form the .sh But when I execute the .sh from python using subprocess.check_call I see the following error: Cloning into bare repository 'repo'... git@mybitbucket.host: Permission denied (publickey). fatal: Could not read from remote repository So the .sh is being executed but somehow I can't auth with my git host. It appears that python or the subprocess does not have access to my ssh keys or ssh config. Is the shell script being executed in some sandbox? What's going on? Continue reading...