Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
All solutions
    • All solutions for Compute Cloud
    • You are unable to add a Committed Volume of Services (CVoS) for Compute Cloud
    • You see a "Permission denied" error when connecting to a VM created in Terraform
    • No nested virtualization support
    • UEFI support and data import from GPT-formatted disks
    • Fixing the "Not enough resources" error on launching a virtual machine
    • Recovering access to a VM with a lost SSH key
    • Fixing issues with creating disk snapshots
    • Boot disk size failed to increase
    • VM instance shuts down on the "instance guest stop processing" operation
    • Fixing the "WARNING REMOTE HOST IDENTIFICATION HAS CHANGED" error
    • Fixing a non-replicable disk breakdown
    • Fixing connection issues with Kosmos VM
    • Fixing password reset issues for VMs based on a Kosmos image
    • Options to migrate a VM image to Yandex Cloud
    • Changing the boot disk for an instance to SSD
    • Getting details about RAM consumption for Compute Cloud instances
    • Creating VMs having multiple network interfaces
    • Decreasing VM disk size
    • Exporting disk images of Compute Cloud VM instances
    • Transferring VMs between folders or clouds
    • Setting up GUI and graphic environment on Linux VMs
    • Using an ISO image for deploying VM instances
    • Monitoring incoming or outgoing VM traffic
    • How to use WinSCP to connect to a Linux VM in Yandex Cloud with a key generated at VM creation
    • How to back up a VM with rollback support
    • How to connect via SSH as root with a password or key
    • How to track memory usage
    • How to save snapshots and images locally
    • How to change an internal IP address
    • How to read the "Connections quota utilization" chart
    • What is the disk access speed for a VM
    • How to create a VM with password access
    • What is the maximum number of network interfaces that can be connected to a VM

In this article:

  • Scenario description
  • Solution
  1. Compute Cloud
  2. How to connect via SSH as root with a password or key

How to connect via SSH as root with a password or key

Written by
Yandex Cloud
Updated at November 27, 2023
  • Scenario description
  • Solution

Scenario descriptionScenario description

You need to connect via SSH from root with a password or key.

SolutionSolution

Connecting with a key
Connecting with a password.

To connect via SSH with a key, make sure that the /root/.ssh/authorized_keys file contains only the key. Everything preceding the key needs to be deleted.

To connect via SSH with a password:

  1. Create a password for root using the sudo passwd root command.

  2. The /root/.ssh/authorized_keys file must be empty or contain only the key. If the key does not match, the file will request a password.

  3. The /etc/ssh/sshd_config.d/50-cloud-init.conf file must contain:

PasswordAuthentication yes
PermitRootLogin yes

Was the article helpful?

Previous
How to back up a VM with rollback support
Next
How to track memory usage
Yandex project
© 2025 Yandex.Cloud LLC