{"id":23123547,"url":"https://github.com/devvyyxyz/logging-ssh-to-discord","last_synced_at":"2026-05-02T23:40:56.718Z","repository":{"id":243758793,"uuid":"813366830","full_name":"devvyyxyz/logging-ssh-to-discord","owner":"devvyyxyz","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-11T00:32:41.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T15:44:21.286Z","etag":null,"topics":["bash","discord","discord-bot","logging","ssh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devvyyxyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-11T00:25:48.000Z","updated_at":"2024-06-11T00:38:53.000Z","dependencies_parsed_at":"2024-06-11T02:38:20.033Z","dependency_job_id":"b5ab1eb5-5b66-4712-961f-9db90a01aaec","html_url":"https://github.com/devvyyxyz/logging-ssh-to-discord","commit_stats":null,"previous_names":["devvyyxyz/logging-ssh-to-discord"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvyyxyz%2Flogging-ssh-to-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvyyxyz%2Flogging-ssh-to-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvyyxyz%2Flogging-ssh-to-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvyyxyz%2Flogging-ssh-to-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devvyyxyz","download_url":"https://codeload.github.com/devvyyxyz/logging-ssh-to-discord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247119697,"owners_count":20886790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","discord","discord-bot","logging","ssh"],"created_at":"2024-12-17T07:35:12.038Z","updated_at":"2025-10-05T20:38:20.166Z","avatar_url":"https://github.com/devvyyxyz.png","language":"Shell","funding_links":["https://www.patreon.com/devvyyxyz"],"categories":[],"sub_categories":[],"readme":"# logging SSH to discord\n![GitHub forks](https://img.shields.io/github/forks/devvyyxyz/modrinth-text-packs)\n![GitHub watchers](https://img.shields.io/github/watchers/devvyyxyz/modrinth-text-packs)\n![GitHub issues](https://img.shields.io/github/issues-raw/devvyyxyz/modrinth-text-packs)\n![GitHub Repo stars](https://img.shields.io/github/stars/devvyyxyz/modrinth-text-packs)\n![GitHub repo size](https://img.shields.io/github/repo-size/devvyyxyz/modrinth-text-packs)\n\nThis script enhances the functionality of Alexander Henderson's original script for logging SSH sessions to Discord. The original script and blog post can be found [here](https://blog.alexsguardian.net/posts/2022/07/02/LoggingSSHtoDiscord/), and credit goes to Alexander Henderson ([alexandzors](https://github.com/alexandzors)).\n\n## Overview\n\nThis Bash script is designed to be added to `/sbin/` and made executable. It integrates with the SSH PAM (Pluggable Authentication Modules) to log SSH session events, such as login and logout, to a Discord channel through a webhook.\n\n## Preview\n![Preview GIF](https://s.tigerlake.xyz/r/brave_m3hM2tyzn0.gif?compress=false)\n\n## Installation\n\n1. **Copy the Script:**\n   - Copy the script to `/sbin/` and make it executable:\n     ```bash\n     sudo touch /sbin/sshd-login\n     sudo chmod +x /sbin/sshd-discord-login.shsudo chmod +x /sbin/sshd-login\n     sudo chown root:root /sbin/sshd-login\n     sudo nano /sbin/sshd-login\n     ```\n\n2. **Edit PAM Configuration:**\n   - Open `/etc/pam.d/sshd` in a text editor.\n   - Add the following line to the bottom of the file:\n     ```plaintext\n     session optional pam_exec.so /sbin/sshd-discord-login.sh\n     ```\n\n3. **Set Permissions for Logging:**\n   - Ensure the log file has the correct permissions:\n     ```bash\n     sudo touch /var/log/seen_ips.log\n     sudo chmod +x /var/log/seen_ips.log\n     sudo chown root:root /var/log/seen_ips.log\n     ```\n\n4. **Set Configuration Variables:**\n   - Edit the script and set the `WEBHOOK_URL`, `DISCORDUSER`, and `URGENT_ROLE` variables to appropriate values.\n\n5. **Restart SSH Service:**\n   - Restart the SSH service for changes to take effect:\n     ```bash\n     sudo service sshd restart\n     ```\n\n## Usage\n\nOnce installed, the script will send messages to the configured Discord channel when users log in or out via SSH. It differentiates between new and known remote hosts, providing additional context.\n\n## Credits\n\n- Original script by Alexander Henderson ([alexandzors](https://github.com/alexandzors)): [LoggingSSHtoDiscord](https://blog.alexsguardian.net/posts/2022/07/02/LoggingSSHtoDiscord/)\n\n## Disclaimer\n\nThis script is provided as-is without any warranty. Use it at your own risk, and ensure that you comply with your organization's policies and guidelines.\n\n## License\n\nThis project is licensed under the MIT - see the [LICENSE](LICENSE) file for details.\n## Deployment\n\n### Replit\n\n[Deploy to Replit](https://replit.com/import/github/devvyyxyz/logging-ssh-to-discord)\n\n### Donate\n\u003ca href=\"https://www.patreon.com/devvyyxyz\" rel=\"noopener nofollow ugc\"\u003e\n\u003cimg src=\"https://wsrv.nl/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2F%40intergrav%2Fdevins-badges%403%2Fassets%2Fcompact%2Fdonate%2Fpatreon-singular_vector.svg\u0026amp;n=-1\" alt=\"paypal-singular\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevvyyxyz%2Flogging-ssh-to-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevvyyxyz%2Flogging-ssh-to-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevvyyxyz%2Flogging-ssh-to-discord/lists"}