Skip to content

Instantly share code, notes, and snippets.

@SpaceNerden
SpaceNerden / sshnotification
Created September 4, 2023 21:07
SSH login notification with Gotify
#!/bin/bash
# Append this command to /etc/pam.d/sshd:
# session optional pam_exec.so <path to script>
# Remember to chown +x!
exec &> /dev/null #Hide output
Gotify_URL='https://gotify.example.com'
Gotify_Token='awawawawawawawawawawawawa'
@SpaceNerden
SpaceNerden / SSHKeys.md
Last active February 18, 2023 01:18
Set up SSH keys on linux: The lazy way

This assumes a couple of things.

  1. You want more keys in the future.
  2. You are on linux.

Step 1: Generate the key.

ssh-keygen -f ~/.ssh/<Name of key, can be anything> -N ''

Step 2: Add following to ~/.ssh/config