I have set up my server to allow key/pair authentication by following instructions similar to what is found in this post.
As far as I can tell that is working correctly. If I do the following, for example, it works correctly:
ssh
[email protected]
It will NOT prompt me for a
password. This is what I want to happen. However if I write a small bash script like this:
#!/bin/bash -x
ssh
[email protected]
and execute with:
sudo ./mytestscript.sh
...it will prompt me with:
[email protected]'s password:
What am I doing wrong? I need to be able to login from within my script without being prompted for a password!