Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic notification when user connects #535

Open
lv913 opened this issue Aug 6, 2024 · 0 comments
Open

Automatic notification when user connects #535

lv913 opened this issue Aug 6, 2024 · 0 comments

Comments

@lv913
Copy link

lv913 commented Aug 6, 2024

Is your feature request related to a problem? Please describe.
I'm trying to implement an auto-notification system which sends me an email when an user connects through Wetty.

Describe the solution you'd like
I have already implemented the following configuration in /etc/ssh/sshrc, which sends me an email when an user connects via SSH. The same doesn't work when connecting from Wetty.

ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
logger -t ssh-wrapper $USER login from $ip
echo "$USER - $ip" | mail -s "SECURITY ALERT: $USER has logged in from $ip" mymail@gmail.com &

Describe alternatives you've considered
I see from documentation that, when running Wetty as root, /bin/login is used for login. It's not clear to me how the same script developed for SSH can be used for /bin/login access.

Additional context
I'm running Wetty as a systemd unit file, configured as follows:

[Unit]
Description=Wetty Web Terminal
After=network.target

[Service]
Type=simple
WorkingDirectory=/usr/local/share/.config/yarn/global/node_modules/wetty/
ExecStart=wetty -p 1234 --host 0.0.0.0 --ssl-key /etc/ssl/cert/privkey.pem --ssl-cert /etc/ssl/cert/fullchain.pem
TimeoutStopSec=20
KillMode=mixed
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant