Skip to content

Automatic notification when user connects #535

@lv913

Description

@lv913

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" [email protected] &

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions