Reputation: 878
How do you automatically start a program when someone connects via ssh.
With ubuntu when someone connects with ssh it automatically shows if any updates are available. I would like an app to automatically run when a person logs in to show them some information.
I've searched on Google to try and find something like this but the only things I can find is how to make the ssh service to start automatically at boot up.
Upvotes: 0
Views: 1345
Reputation: 62476
You can put a script in ~/.ssh/rc
. From the sshd
man page:
~/.ssh/rc
Contains initialization routines to be run before the user's home directory becomes accessible. This file should be writable only by the user, and need not be readable by anyone else.
You can alsoe use the /etc/ssh/sshrc
file.
/etc/ssh/sshrc
Similar to ~/.ssh/rc, it can be used to specify machine-specific login-time initializations globally. This file should be writable only by root, and should be world-readable.
For more information, read the SSHRC section of the sshd man page.
Upvotes: 3