DEV Community

David Loor
David Loor

Posted on • Originally published at davidloor.com on

How to SSH login to a server without being prompted for the password

boy in white t shirt sitting on chair in front of computer

You purchased a new server, and want to SSH login into it, so you use the command ssh remote_username@server_ip_address , and you are prompted for the password of the remote_username. if you would need to enter the password a couple of times is ok, but if you need to SSH login multiple times that is a pain.

ssh-copy-id is a command that is used to install your public SSH key on a remote server. This allows you to use SSH key-based authentication to log in to the remote server without having to enter a password.

To use ssh-copy-id, you will need to have an SSH key pair. If you don’t have an SSH key pair, you can generate one using the ssh-keygen command. Once you have your SSH key pair, you can use the ssh-copy-id command to install your public key on the remote server.

The syntax of the command is as follows: ssh-copy-id remote_username@server_ip_address You will be prompted for the remote_username’s password one the last time, and after that, you won’t be prompted for the password anymore.

Example of use of the command ssh-copy-id

ssh-copy-id david@mynicesite.com
Enter fullscreen mode Exit fullscreen mode

This would install your public SSH key on the remote server at mynicesite.com, using the username “david”.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs