SSH-ADD being not permament

problem: ssh-add needs to run every single time on server and client for passwordless login.

solution(server):
Execute in Bash:
ssh-copy-id -i ~/.ssh/key.pub username@hostname

solution-not so good(client):
Add lines in ~/.bashrc
# User specific aliases and functions
eval `ssh-agent` >> /dev/null
ssh-add ~/.ssh/key > /dev/null < /dev/null 2>&1

solution-better(client):
create a new file called config in ~/.ssh/ (if it does not exist)
in ~/.ssh/config:
IdentityFile ~/.ssh/key

Note:
file permissions for the keys must be set at 700.

Comments