SSH keys

  • To generate new ssh keys
    • ssh-keygen -t ed25519 -C “[email protected]
    • creates keypair in ~/.ssh/{id_ed25519.pub,id_ed25519}
      • The .pub file is the public key

SSHD

  • Install sshd with    - sudo apt install openssh-server
  • Modify configuration of /etc/ssh/sshd_config and    - Add AllowUsers sagar at the end    - Set PermitRootLogin No
  • Restart    - sudo systemctl restart sshd    - sudo systemctl restart sshd
  • Typically, also remember to fail2ban
  • Make sure that UFW is configured.