You need ssh key to connect to the server without a password.
I. Create a new ssh key
Enter the command:
ssh-keygen -t rsa -b 4096 -C "login@mail.com"
The terminal asks you to set a password for the key and specify the location where it will be located. If you don't need it just press enter to the end.
The file will be located at:
/home/user/.ssh/id_rsa.pub
The contents of this file are your public key.
II. Add ssh key to the server
Enter the command:
ssh-copy-id user@server.com
Enter the password.
PROFIT.
Top comments (2)
It would be a really bad idea to not password-protect your key (especially if you're logging in to an account that has sudoers capabilities).
I agree but it is a case study. I tried to write it shortly.