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/24 08: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 [ " | ||
if [ -x / | if [ -x / | ||
- | #echo " | ||
/ | / | ||
if [ -f ~/ | if [ -f ~/ | ||
Line 33: | Line 38: | ||
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 41: | Line 47: | ||
alias ssh=' | alias ssh=' | ||
fi | fi | ||
+ | |||
</ | </ | ||
Line 47: | 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. |