I have to run the following commands each time I restart:
ssh-agent /bin/bash
ssh-add ~/.ssh/key_rsa
First question is why is /bin/bash
necessary and what it is used for?
Second, Is it ok I run these commands every time on restart, or should I put this in .bashrc
or somewhere so I don't have to ssh-add
everytime.
Note that I use screen
and every screen tab is different and I have to run these commands for every screen tab.
Edit:
For example when I need to push to github I need to do ssh-add ~/.ssh/github_rsa
, but this doesn't work unless I do ssh-agent /bin/bash
first.
This might be related to screen
because plain ssh-agent
doesn't work, and ssh-agent is already running, yet I have to do ssh-agent /bin/bash
.
keychain --eval id_rsa id_dsa
"ssh-add github_rsa
if I haven't done already. (ssh-add
doesn't work by default so I have to runssh-agent /bin/bash
first). Can you explain your solution a little more, what iskeychain
and post it as answer. Also see my edit please.