This question already has an answer here:
I have a scenario where, whenever a user logs into a CENTOS machine via SSH, I need to have the following commands run:
ssh-agent bash ssh-add
[This other thread explains why I am using those commands:
I have tried putting those into .bashrc, but then when I log in via Putty, it seems like the log in hangs.
I have also tried putting the two commands in a shell script, and then running the shell script manually after logging in, but that is not working (it looks like only the "ssh-agent bash" is run).
So is it possible to get those 2 commands to be run when the user logs in? And if so, how can I do that?