Campuses:
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
computing:department:unix:ssh_keychain [2008/07/23 09:19] – rubin | computing:department:unix:ssh_keychain [2019/06/17 10:24] (current) – [Using keychain with SSH] sull0153 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using keychain with SSH ====== | ====== Using keychain with SSH ====== | ||
- | If you use ssh's built in public-key/ | + | If you use ssh's built in public-key/ |
===== Overview ===== | ===== Overview ===== | ||
Line 22: | Line 22: | ||
Add the following to your ~/.bashrc file: | Add the following to your ~/.bashrc file: | ||
< | < | ||
+ | # Clear existing broken ssh-agent environment | ||
+ | # | ||
+ | if [ ! -f " | ||
+ | export SSH_AUTH_SOCK="" | ||
+ | fi | ||
+ | |||
# if ssh auth forwarding is enabled, use it and dont start keychain | # if ssh auth forwarding is enabled, use it and dont start keychain | ||
if [ " | if [ " | ||
- | | + | |
- | ~/ | + | /usr/ |
- | #if your using a dsa key, change rsa above to dsa | + | |
- | + | | |
- | source | + | fi |
- | # if you use tcsh or csh use $HOSTNAME-csh instead in above | + | fi |
fi | fi | ||
- | # If we have ssh-agent running, forward it to the next host. Otherwise | + | # If we have ssh-agent running, forward it to the next host, |
+ | # otherwise | ||
if [ " | if [ " | ||
# if we dont have an auth sock, dont use pub key identification | # if we dont have an auth sock, dont use pub key identification | ||
Line 40: | Line 47: | ||
alias ssh=' | alias ssh=' | ||
fi | fi | ||
+ | |||
</ | </ | ||
Line 46: | Line 54: | ||
source ~/.bashrc | source ~/.bashrc | ||
- | Now if you log out and back in to x, you should get prompted the first time you open a command shell for your private key. After that you can ssh anywhere and through multiple systems without being asked your password again. | + | Now if you log out and back in to x, you should get prompted the first time you open a command shell for your private key. After that you can ssh anywhere and through multiple systems without being asked your password again. |