Hacker News new | ask | show | jobs
by boobePhuu7iet7i 2490 days ago
Do you add that on your system, and it executes the commands on all the servers you connect to?

Or do you add it to the server and they only run when you login to that server?

2 comments

Looks like it executes the commands only on the server where ~/.ssh/rc or /etc/ssh/sshrc exists.

> ~/.ssh/rc

> Commands in this file are executed by ssh when the user logs in, just before the user's shell (or command) is started. See the sshd(8) manual page for more information.

You add it to the remote system.

I use it for updating a symlink in a known location to point to SSH_AUTH_SOCK. I then get tmux sessions set up to look in that location. Effectively, each time I ssh in, I fix all the ssh forwarding in active sessions (this is on local dev vagrant machines).