Update function to sanitise file permissions.
Export relevant SSH variables to ssh-agent environment file.