apt install openssh
sshd
touch ~/.ssh/authorized_keys
# Set Permissions to the file
chmod 600 ~/.ssh/authorized_keys
# Make sure the folder .ssh folder has the correct permissions
chmod 700 ~/.ssh
ssh-keygen
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# -i $PATH_TO_FILE/filename is only required if the id_rsa file is not ~/.ssh/id_rsa
ssh localhost -p 8022 -i %PATH_TO_KEY-FILE%/%NAME_OF_KEY%