{"id":15655063,"url":"https://github.com/torxed/ssh_mailer","last_synced_at":"2025-03-24T01:44:28.548Z","repository":{"id":150500849,"uuid":"217024114","full_name":"Torxed/ssh_mailer","owner":"Torxed","description":"Sends e-mail whenever someone logs in to SSH (Triggers via PAM)","archived":false,"fork":false,"pushed_at":"2019-10-23T15:07:36.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T17:16:28.250Z","etag":null,"topics":["information","mail","pam","security","security-audit","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Torxed.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":"2019-10-23T09:52:46.000Z","updated_at":"2021-04-02T08:28:51.000Z","dependencies_parsed_at":"2023-07-07T08:15:13.189Z","dependency_job_id":null,"html_url":"https://github.com/Torxed/ssh_mailer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torxed%2Fssh_mailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torxed%2Fssh_mailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torxed%2Fssh_mailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torxed%2Fssh_mailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Torxed","download_url":"https://codeload.github.com/Torxed/ssh_mailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245195908,"owners_count":20575936,"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":["information","mail","pam","security","security-audit","ssh"],"created_at":"2024-10-03T12:55:59.938Z","updated_at":"2025-03-24T01:44:28.529Z","avatar_url":"https://github.com/Torxed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssh_mailer\nSends e-mail whenever someone logs in to SSH (Triggers via PAM)\n\n# Installation\n\nCopy `ssh_mailer.py` to `/usr/bin/` and `chmod +x /usr/bin/ssh_mailer.py`.\u003cbr\u003e\nThen add the following to `/etc/pam.d/sshd`:\n\n```\nsession   optional  pam_exec.so seteuid /usr/bin/ssh_mail.py\n```\n\nThen create certificates:\n\n```\nmkdir -p /etc/sshmailer\nopenssl genrsa -out /etc/sshmailer/sshmailer.pem 1024\nopenssl rsa -in /etc/sshmailer/sshmailer.pem -out /etc/sshmailer/sshmailer.pub -pubout\nchmod 440 /etc/sshmailer/sshmailer.*\n```\n\nAnd copy the public part of the cert *(without the `--- BEGIN ---` parts)* into your DNS TXT record, which should look something like:\n\n```\ncat /etc/sshmailer/sshmailer.pub\nINSERT INTO records (name, type, content) VALUES ('default._domainkey.hvornum.se', 'TXT', 'v=DKIM1;k=rsa;p=MIGfMA+PUejXCfAQAB');\n```\n\nNow, whenever you login via SSH, PAM should execute `ssh_mail.py`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorxed%2Fssh_mailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorxed%2Fssh_mailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorxed%2Fssh_mailer/lists"}