Permalink
Browse files

kestrel-lib: user_sshkeygen, add "ssh-add ~/.ssh/kestrel_id_dsa" to ~…

…/.bashrc

This way we avoid people getting mad with ssh-agent troubles
  • Loading branch information...
1 parent 986e73c commit 74a12fe4a0d17d343a3385a2878142335b8cf442 @jonanh jonanh committed Apr 16, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 share/kestrel-lib
View
@@ -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
}

0 comments on commit 74a12fe

Please sign in to comment.