Setting up a Debian server
SSH configuration
Login on you server as root and create a new user (change the username to your preferences).
On your local computer generate a new key for SSH.
Then copy the created key on the server using ssh-copy-id
utilitary
on server cat .ssh/authorized_keys to test
Edit the file /etc/ssh/sshd_config
and do the following modifications:
- Uncomment
Port
and set to whatever you want - Uncomment
authorizedKeysFiles
- Set the line
PasswordAuthentication no
- Uncomment
PermitRootLogin no
- Add the line
AllowUsers myuser
Then restart the ssh daemon with systemctl restart sshd
.
Don't forget to update your packages.