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:
ssh-add complains: Could not open a connection to your authentication agent ]
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?
Thanks, Jim
ssh-agent
andssh-add
are run locally not on the remote machine. What OS is running on the local machines? ... If it's Windows and you are using putty, maybe this Q/A will be helpful.... – RubberStamp Sep 20 '18 at 13:59