---
title: "How to set up passwordless SSH key login on a VPS | StreetHosting"
description: "Generate an SSH key pair, copy the public key to your VPS, and log in without typing a password. Safer and more convenient than passwords, step by step."
url: "https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps"
type: "page"
language: "en-US"
---

VPS · 3 min · Intermediate

Published on Jun 17, 2026 · Updated on Jun 17, 2026

# Set up passwordless SSH key login on a VPS

Key-based login is safer and easier than a password. You generate a key pair, copy the public key to the server, and log in without typing anything. Here is how, in a few steps.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Security and hardening](https://streethosting.com.br/en/guides/topics/security) [Linux administration](https://streethosting.com.br/en/guides/topics/linux)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20set%20up%20passwordless%20SSH%20key%20login%20on%20a%20VPS&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps "Share on LinkedIn") [](https://wa.me/?text=How%20to%20set%20up%20passwordless%20SSH%20key%20login%20on%20a%20VPS%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fpasswordless-ssh-login-vps "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps.md)

In this guide 5 sections

* [Why use a key](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#por-que-chave)
* [Generate the key](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#gerar-chave)
* [Copy it to the VPS](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#enviar-chave)
* [Disable password login](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#desativar-senha)
* [Looking after your key](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#cuidados)

Quick answer

To log in to your VPS **without a password**, generate a key pair with `ssh-keygen`, copy the public key with `ssh-copy-id`, and test the key login. Then disable password authentication in SSH. The private key stays only with you, which makes access safer and more convenient than a password.

## Why use a key[](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#por-que-chave)

A password can be guessed by trial and error, and bots comb the internet trying thousands of them per minute. An SSH key solves that: the private half never leaves your computer and is far too large to be cracked by brute force. It is the first concrete step toward any [secure SSH setup](https://streethosting.com.br/en/guides/vps/secure-ssh-linux-vps).

## Generate the key[](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#gerar-chave)

1. On your computer, run `ssh-keygen`.
2. Choose where to save it and set a passphrase.
3. This creates two parts: the private key, which stays with you, and the public key, which goes to the server.

Never share the private key or commit it to a repository. It is the equivalent of the key to your house. The public key can go anywhere.

## Copy it to the VPS[](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#enviar-chave)

The simplest way is `ssh-copy-id usuario@IP`, which puts the public key in the right place automatically. If you prefer to do it by hand, add the contents of the public key to the user's `authorized_keys`file. Then test by opening a new session: you should get in without typing the user's password.

If your first login is not set up yet, start with [how to access your VPS for the first time](https://streethosting.com.br/en/guides/vps/connect-to-vps-via-ssh-first-time).

## Disable password login[](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#desativar-senha)

Once the key works, turn off password authentication in the SSH configuration and restart the service. From then on, only people with the key can get in, which eliminates guessing attacks. Combine it with [Fail2ban](https://streethosting.com.br/en/guides/vps/fail2ban-ssh-vps-setup) for layered defense.

## Looking after your key[](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#cuidados)

* Private key protected by a passphrase
* Secure backup of the private key
* Password login disabled after testing the key
* Emergency access planned for critical servers

The key is powerful, so take the backup seriously. To pick the right machine for your services, compare the lines in [Ryzen VPS](https://streethosting.com.br/en/vps/ryzen) and [Xeon VPS](https://streethosting.com.br/en/vps/xeon).

In this guide

* [Why use a key](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#por-que-chave)
* [Generate the key](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#gerar-chave)
* [Copy it to the VPS](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#enviar-chave)
* [Disable password login](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#desativar-senha)
* [Looking after your key](https://streethosting.com.br/en/guides/vps/passwordless-ssh-login-vps#cuidados)

## Frequently asked questions

Is an SSH key more secure than a password?

Yes. The private key never travels over the network and is practically impossible to guess by brute force, unlike a password. That is why key-based login is the recommended standard for servers.

Can I use the same key on several VPSs?

Yes. Just copy the same public key to each server. The private key stays only with you. Still, keeping separate keys for separate purposes makes it easier to revoke access later.

Should I protect the private key with a passphrase?

Yes, it is recommended. The passphrase protects the key if someone else gets access to your computer. An SSH agent keeps the passphrase for the session so you do not have to type it every time.

What if I lose the private key?

You lose access through that key. That is why you should keep a secure backup of the private key and, on critical servers, set up a second emergency access method.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[See Ryzen VPS Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.](https://streethosting.com.br/en/vps/ryzen) [See Xeon VPS Xeon VPS for steady workloads, automation and long-running projects.](https://streethosting.com.br/en/vps/xeon)

## Related guides

[VPS Intermediate How to secure SSH on a Linux VPS: keys, passwords, fail2ban SSH is usually the first target on any VPS with a public IP. This guide walks through a practical routine that cuts the risk without complicating your day: an ED25519 key, password-free login, admin access through sudo, blocking of automated attempts and a periodic review of authorized keys. 4 min Read guide](https://streethosting.com.br/en/guides/vps/secure-ssh-linux-vps) [VPS Beginner How to connect to your VPS for the first time via SSH You bought the VPS and received an IP, a user and a password. Now it is time for the first login. Here is how to connect over SSH from any system and what to do in the first few minutes. 3 min Read guide](https://streethosting.com.br/en/guides/vps/connect-to-vps-via-ssh-first-time) [VPS Intermediate How to set up Fail2Ban on a VPS: SSH, Nginx and repeat offenders Fail2Ban reads your logs, spots the IPs that fail too often and bans them in the firewall. Learn how to set it up on Ubuntu 24.04, where the package defaults change how jails behave, and how to manage bans day to day. 8 min Read guide](https://streethosting.com.br/en/guides/vps/fail2ban-ssh-vps-setup)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
