SSH: Difference between revisions

From Dev Wiki
Jump to navigation Jump to search
(Create page)
(No difference)

Revision as of 07:02, 14 March 2020

Setting up Password-less Server Credentials

This is done by passing a ssh public key to the server you wish to connect to.

First, you'll need to be able to make ssh connections with passwords. If not already enabled on the server, then enable it with the following:

  • Edit the file /etc/ssh/sshd_config
  • Update the line PasswordAuthentication to yes
  • Restart the service with sudo service ssh restart

Next, pass your public key to the server with the command:
ssh-copy-id -i <public_key_to_pass> <server_address>

Test that it works by connecting to the server with ssh. It should connect without asking for a password.

Finally, disable ssh connections with passwords to make the server more secure:

  • Edit the file /etc/ssh/sshd_config
  • Update the line PasswordAuthentication to no
  • Restart the service with sudo service ssh restart