Skip to content

Commit

Permalink
kestrel-lib: user_sshkeygen, add "ssh-add ~/.ssh/kestrel_id_dsa" to ~…
Browse files Browse the repository at this point in the history
…/.bashrc

This way we avoid people getting mad with ssh-agent troubles
  • Loading branch information
jonanh committed Apr 16, 2012
1 parent 986e73c commit 74a12fe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions share/kestrel-lib
Expand Up @@ -333,6 +333,13 @@ user_sshkeygen() {
# Ensure the .ssh/* files have the correct owner/group and permissions.
chown -R ${user}:${user_group} ${user_home}/.ssh
chown -R ${user}:${user_group} ${user_khome}/.ssh

local bashrc=${user_home}/.bashrc
if [ -e "${bashrc}" ]; then
sed -ir '/ssh-add.*kestrel_id_dsa/d' ${bashrc}
echo "ssh-add -d ~/.ssh/kestrel_id_dsa &>/dev/null" >> ${bashrc}
echo "ssh-add ~/.ssh/kestrel_id_dsa &>/dev/null" >> ${bashrc}
fi
}


Expand Down

0 comments on commit 74a12fe

Please sign in to comment.