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

CategoriesUncategorized

Leave a Reply