Crmgo Blog

SSH without password input

SSH without password input

To log in to a remote server without entering a password, we need SSH keys. Let's start generating them: When prompted for a passphrase, leave it empty; otherwise, you'll have to re-enter it every time you connect. The save path can be arbitrary. Before copying the public key to the server, rename it…

SSH without password input

To log in to a remote server without entering a password, we need SSH keys. Let's start generating them:

ssh-keygen -t rsa

When prompted for a passphrase, leave it empty; otherwise, you will have to enter it every time you connect. The save path can be arbitrary.

Before copying the public key to the server, rename it to authorized_keys:

cd ~/.ssh
cp id_rsa.pub authorized_keys

Copy the public key to the remote machine:

cd ~/.ssh
scp authorized_keys user@host.servername.com:/root/.ssh/

You can also copy the key using ssh-copy-id, specifying the port with the -p option.

ssh-copy-id '-p 11000 user@host.servername.com'

Now you can log in without entering a password:

ssh user@host.servername.com

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.