October 19, 2024

Create SSH-key

ssh-keygen -t ed25519 -C "AAABBBCCC@gmail.com"

Pass SSH-key to your host

ssh-copy-id -i ${identity_file} ${USER}@${HOST}

Edit ssh-config

sudo vi /etc/ssh/sshd_config
PasswordAuthentication no
PubkeyAuthentication yes

Restart OPEN-SSH-Server

sudo systemctl restart sshd

Control Open-SSH-Server via systemctl command

$ sudo systemctl start ssh
$ sudo systemctl stop ssh
$ sudo systemctl restart ssh
$ sudo systemctl reload ssh

Edit .ssh/config for short command access

Host mydesktop (you can choose the name)
  HostName 172.***.***.***
  User myname
  IdentityFile ~/.ssh/id_ed25519

Access host server using config

ssh mydesktop