Write to the right credentials file