DEV Community

Discussion on: SSH - Configurations

Collapse
 
brandonwallace profile image
brandon_wallace • Edited

Here are some tips my friend.

Here is a better command to run to create the ssh key.

$ ssh-keygen -t rsa -b 4096 -C “brandon@example-email.com” -f ~/.ssh/id_rsa

Then you copy the public key to the server with this one command. It will create the authorized_keys file automatically.

$ ssh-copy-id -i ~/.ssh/id_rsa.pub username@server_ip_address

Chain these commands together like this.

$ eval $(ssh-agent -s); ssh-add /home/$USER/.ssh/id_rsa

Make sure you have sudo access, then lock the root account. It will add more security to your server.

$ sudo passwd -l root