Upon any ssh login/connection (anybody logging in through ssh), is there a way to have a script executed?
Using OpenSSH server.
The script should not be modifiable by any of the users, — of course –, so this should be a system-wide script.
Thanks!
executionloginscriptingssh
Upon any ssh login/connection (anybody logging in through ssh), is there a way to have a script executed?
Using OpenSSH server.
The script should not be modifiable by any of the users, — of course –, so this should be a system-wide script.
Thanks!
Best Answer
If you're looking to do it non-intrusively to the user's experience, take a look at a syslog substitute (e.g. syslog-ng). You can trigger the command on the log messages sent to syslog by the SSH server when someone logs in.
This approach is a little rube-goldbergian, and depends on syslog working correctly. YMMV, IMHO, SLATFATF