How to connect without password using SSH (passwordless)

SSH Secure Shell Protocol is a cryptographic protocol for secure data connection and remote command execution.

From the terminal, we create an ssh key pair through issuingand: ssh-keygen
Press Enter three times until the command finishes. A public key file “~/.ssh/id_rsa.pub” and a private key file “~/.ssh/id_rsa” will be generated.

Now that we have generated an SSH key pair, we need copy the public key to the server we want to manage through the below command

$ ssh-copy-id remote-username@remote_server-ip-address

That’s it. you can ssh to the server: $ ssh remote-username@remote_server-ip-address