Tip for scripting using ssh keys

Always put the path to the key you are using in the script. I’ve spent about a week fixing a script where it would grab the root user’s ssh keys since I sudo to root to run it and it should have been running as another user. Example:

scp -v -i /path/to/key file user@host:/path

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: