So I'm currently working on a load balancing python script. In this script I will need to update a file on a server. My plan is to have my python script call a bash script.
In that bash script I'd like to ssh into the server, execute an awk command on a file, then logout.
I can currently ssh into this server manually, because I've set up an ssh key (using Google Cloud Platform). But when I try to run a bash script that only executes
'ssh username@externalIP'
I get the error: Permission denied (publickey)
What am I missing here?
ssh -vv username@ip
in conditions where the issue reproduces and combing through the logs would be a place to start. (If everything looks good when reviewing those logs on the client, bumping the debug level on the server side would be a place to continue). – Charles Duffy Oct 10 '17 at 21:37ls -la
output for your .ssh directory and for the key file. – Kenster Oct 10 '17 at 21:54