- Common zshrc, aliases and functions
- ZPlug
- zsh-histdb
- zlua
- bgnotify (only tested on iterm2)
The first thing we need to do is make sure our ssh keys are set up correctly. I use two different keys with aliases in my ~/.ssh/config. GitHub has some great documentation about this process.
-
Generate a new pair of ssh keys:
ssh-keygen -t ed25519 \ -f ~/.ssh/id_ed25519_personal_email_example_com \ -C "[email protected]" ssh-keygen -t ed25519 \ -f ~/.ssh/id_ed25519_work_email_example_com \ -C "[email protected]"
- Update for using yubikey 2fa signed keys.
The
-O verify-required
flag forced a pin check and the-O resident
flag stores the keyref in my yubikey so I can take it to another machine should I so desire.ssh-keygen -t ed25519-sk -O verify-required -O resident \ -f ~/.ssh/id_ed25519_sk_personal_email_example_com \ -C "[email protected]" ssh-keygen -t ed25519-sk -O verify-required -O resident \ -f ~/.ssh/id_ed25519_sk_work_email_example_com \ -C "[email protected]"
-
Open ~/.ssh/config file, then add the following lines.
If the SSH keyfile has a different name or path than the example code, modify the filename or path to match your current setup.
Host * AddKeysToAgent yes UseKeychain yes
At some point this changed and you might eed to add the following line to the ssh config before the above lines.
Host * IgnoreUnknown AddKeysToAgent,UseKeychain AddKeysToAgent yes UseKeychain yes
-
While we are in ~/.ssh/config, lets set up our GitHub aliases.
There is probably a better way to do this but this works for now and forces me to intentionally use the right alias for each one instead of swapping them out one at a time in the agent and accidentally forgetting which one I have loaded.
# Work GitHub Alias Host w.github.com HostName github.com User git IdentityFile ~/.ssh/id_ed25519_work_email_example_com # Personal GitHub Alias Host p.github.com HostName github.com User git IdentityFile ~/.ssh/id_ed25519_personal_email_example_com
-
Copy our public keys into our two GitHub accounts.
Log in and go to the account bubble and select
Settings->SSH and GPG Keys->New SSH Key Give the new key a name that identifies the type and system on which it was generated like "Macbook ed25519 Personal Key" -
Time to clone our repo. I store my dotfiles in my personal github repo. I use the same repo on pretty much every device I own - Windows (WSLv2), MacOS, Linux, Raspberry Pi(WIP) and I didn't want it tied to my employers account. Switching repos is as simple as using the w.github.com alias.
git clone [email protected]:<your_gh_repo>/dotfiles.git \ ~/.dotfiles
-
Now we just cd into the directory and run our bootstrap.sh to set up our symlinks
cd ~/.dotfiles ./bootstrap.sh
I don't generally have to interact with my work github repo from VMs, so the general steps are as above just skipping the second key and ~/.ssh/config alias.
-
Set up personal ssh-key and alias (See Above)
-
Clone the repo
git clone [email protected]:sdrush/dotfiles.git \ ~/.dotfiles --recurse-submodules
-
Run the bootstrap
cd ~/.dotfiles ./bootstrap.sh
- TBD