envoi mail après login
This commit is contained in:
parent
651a0d3c64
commit
a93d836d36
@ -11,6 +11,16 @@ let
|
||||
musique_port = 52349;
|
||||
factorio_port = 52351;
|
||||
airsonic_port = 4040;
|
||||
|
||||
login_mail_alert = pkgs.writeShellScriptBin "mail_alert.sh" ''
|
||||
if [ "$PAM_TYPE" != "close_session" ]; then
|
||||
${pkgs.system-sendmail}/bin/sendmail paul@nyanlout.re <<EOF
|
||||
From: root@nyanlout.re
|
||||
Subject: SSH Login: $PAM_USER from $PAM_RHOST
|
||||
`env`
|
||||
EOF
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
@ -415,9 +425,12 @@ in
|
||||
|
||||
users.groups.acme.members = [ "matrix-synapse" ];
|
||||
|
||||
security.sudo.extraRules = [
|
||||
{ commands = [ { command = "${pkgs.smartmontools}/bin/smartctl"; options = [ "NOPASSWD" ]; } ]; users = [ "telegraf" ]; }
|
||||
];
|
||||
security = {
|
||||
sudo.extraRules = [
|
||||
{ commands = [ { command = "${pkgs.smartmontools}/bin/smartctl"; options = [ "NOPASSWD" ]; } ]; users = [ "telegraf" ]; }
|
||||
];
|
||||
pam.services.sshd.text = pkgs.lib.mkDefault( pkgs.lib.mkAfter "session optional ${pkgs.pam}/lib/security/pam_exec.so seteuid ${login_mail_alert}/bin/mail_alert.sh" );
|
||||
};
|
||||
|
||||
networking = {
|
||||
wireguard.interfaces = {
|
||||
|
Loading…
Reference in New Issue
Block a user