# ⛔️ SSH Access

## Script

```bash
#!/bin/bash
if [ "${PAM_TYPE}" = "open_session" ]; then
  curl \
      -H "Title: SSH Login" \
      -H "Priority: urgent" \
      -H "Tags: warning,door" \
      -d "Hello TTBB! There was an SSH login with user ${PAM_USER} from ${PAM_RHOST} host" \
      https://notify.boreux.work/pihole?auth=<TOKEN>
fi
```

## `/etc/pam.d/sshd`

At the end of the file, add the following line:

```bash
session optional pam_exec.so /root/ntfy/ssh-login.sh
```