How can I start a SH application when someone makes a ssh connection?

Hello everyone,

I'm trying to control the access in my server. I did an application that can read audit logs and sys logs with the purpose to send me a report by email with important information about the user. It's a SH file. My problem is start the program when someone makes a ssh connection. Suggestions and advices are welcome.

Thanks,
journey

You may be able to glean the information you want by watching your system logs.

You could also have the users' login scripts notify your management scripts.

You could also have the users' login scripts notify your management scripts.

How can I do that?

Edit their login script to run the program. What the login script is depends on their login shell. It may be ~/.profile. There may be a global login script at /etc/profile

1 Like

Thank you so much!!! Great!!...