Dotfiles Meet Security
Dotfiles added to version control? Check.
Signed up for website requiring authentication? Check.
Use a command line tool to connect with said website? Check.
Running OS X? Check.
Authentication credentials should not be checked into version control. Use Security.
Add password to keychain
$ security add-generic-password -a YOUR_LOCAL_OSX_USER -s github.password -w YOUR_GITHUB_PASSWORD
Export environment variable with value from key
$ export GITHUB_PASSWORD=$(security 2>&1 >/dev/null find-generic-password -gs github.password | sed 's/password: "\(.*\)"/\1/')
Automate export from dotfile
https://github.com/simeonwillbanks/dotfiles/blob/master/oh-my-zsh/custom/simeon.zsh#L8-L9
Stay safe my friends.
Written by Simeon Willbanks
Related protips
2 Responses
The link you posted to your dotfiles is unavailable.
over 1 year ago
·
@nerdfunk... sorry. Here is a permalink: https://github.com/simeonwillbanks/dotfiles/blob/8ac1c54e8a54c74f80fa9797ce35dd3b86d60be0/oh-my-zsh/custom/simeon.zsh#L9
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Osx
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#