SSH
Generate a ssh key
ssh-keygen -t ed25519 -C "$USER@$(hostname)"
Change SSH server config
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.save
nano /etc/ssh/sshd_config
systemctl restart sshd
lsof -i -P -n | grep ssh
Generate a lot a ssh keys
#!/bin/bash
mkdir -p temp
number=100000
for i in $(seq 1 $number)
do
ssh-keygen -t ed25519 -f "temp/sshkey${i}" -q -N ""
done
Kill ssh
killSSH() {
while true; do pkill -f "sshd: $USER"; done
}
SSH Config example
# ~/.ssh/config
Host myconfigname
HostName website.fr
User username
IdentityFile ~/.ssh/mykey