Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex BareMetal
    • All guides
      • Renting a stock configuration server
      • Renting a custom-configured server
      • Getting information about a server
      • Reconfiguring a server
      • Connecting to the KVM console
      • Stopping and starting a server
      • Canceling a server rent
      • Restoring a server from quarantine
      • Uploading a custom OS image
      • Connecting an existing BareMetal server to Cloud Backup
      • Using the Rescue CD
      • Setting up a secondary private subnet
      • Switching the type of a network connected to a network interface
      • Configuring the MC-LAG aggregation group
      • Resetting a password on the server
      • Replacing a disk in a RAID array
      • Adding a new SSH key for a user
      • Restoring the OS bootloader
      • Analyzing server status using HWCheck
    • Overview
    • Integrating with other Yandex Cloud services
      • Overview
      • Stock server configurations
      • Custom server configuration
      • On-request server configuration
      • Overview
      • Public network
      • Private network
      • DHCP
      • MC-LAG
      • Restrictions in BareMetal networks
      • Overview
      • Images
      • Access management
      • Additional server settings
      • Management console
      • Monitoring metrics
    • Quotas and limits
  • Pricing policy
  • FAQ
  1. Step-by-step guides
  2. Servers
  3. Resetting a password on the server

Resetting the server root password

Written by
Yandex Cloud
Updated at July 13, 2026
View in Markdown

The system automatically generates a root password during BareMetal server provisioning. You must save this password, as it will become inaccessible after server initialization.

If you have lost your BareMetal server root password, you can create a new one. Depending on the situation, you can do it in different ways.

Tip

To paste clipboard text to the KVM console, use the Paste text here field in the upper right corner.

If you still have SSH key access to the server
If you do not have access to the server

If you still have root SSH access via the key specified during server setup, you can reset the root password without using Rescue CD:

  1. Connect to the server over SSH:

    ssh root@<server_public_IP_address>
    
  2. To change the root password on the BareMetal server OS, run this command:

    passwd root
    

    At the system prompt, enter and confirm the new password:

    New password:
    Retype new password:
    

    Result:

    passwd: password updated successfully
    

    Note

    At this stage, you can also add a new SSH key, modify other server OS settings to ensure proper booting and network connectivity, and diagnose and troubleshoot errors.

If you do not have root SSH access to the server, reset the root password using the Rescue CD boot image: Proceed with the following steps in the KVM console.

To reset the root password or change other BareMetal server settings:

  1. Start the server from the Rescue CD image.

    In the main SystemRescue menu, select Boot SystemRescue using default options, press ENTER and wait for SystemRescue to load.

  2. View information about server storage devices, including disks and their partitions:

    fdisk -l
    

    Result:

    Disk /dev/sda: 838.36 GiB, 900185481216 bytes, 1758174768 sectors
    Disk model: SAMSUNG MZ7GE900
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/0 size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: D79F5407-DEEC-4A1D-983F-3AC5********
    
    Device      Start      End         Sectors      Size  Type
    /dev/sda1   2048       614399      612352       299M  BIOS boot
    /dev/sda2   614400     21585919    20971520     10G   Linux filesystem
    /dev/sda3   21585920   34168831    12582912     6G    Linux filesystem
    /dev/sda4   34168832   1732861951  1698693120   810G  Linux filesystem
    
    
    Disk /dev/sdb: 838.36 GiB, 900185481216 bytes, 1758174768 sectors
    Disk model: SAMSUNG MZ7GE900
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/0 size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: CDZACB4C-1618-4BAF-A6BB-D2B9********
    
    Device      Start      End         Sectors      Size  Type
    /dev/sdb1   2048       614399      612352       299M  BIOS boot
    /dev/sdb2   614400     21585919    20971520     10G   Linux filesystem
    /dev/sdb3   21585920   34168831    12582912     6G    Linux filesystem
    /dev/sdb4   34168832   1732861951  1698693120   810G  Linux filesystem
    
    Disk /dev/md127: 6 GiB, 6438256640 bytes, 12574720 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/0 size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/md126: 9.99 GiB, 10729029632 bytes, 20955136 sectors = 512 bytes
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/0 size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/md125: 809.88 GiB, 869596659712 bytes, 1698430976 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/0 size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/loop: 824.97 MiB, 865046528 bytes, 1689544 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    

    In the example above, the fdisk utility displayed information about the /dev/sda and /dev/sdb physical disks, their partitions, and the partitions of the server’s RAID array: /dev/md127, /dev/md126, and /dev/md125.

    The /dev/sda and /dev/sdb disks are configured in a RAID array, and the 809.88 GiB /dev/md125 partition contains the server OS root filesystem. This is the partition you need to mount.

  3. Mount the partition with the BareMetal server OS root filesystem:

    mount /dev/md125 /mnt
    
  4. Create a new SystemRescue shell environment using the server OS’s previously mounted BareMetal filesystem:

    chroot /mnt /bin/bash
    
  5. To change the root password on the BareMetal server OS, run this command:

    passwd root
    

    At the system prompt, enter and confirm the new password:

    New password:
    Retype new password:
    

    Result:

    passwd: password updated successfully
    

    Note

    At this stage, you can also add a new SSH key, modify other server OS settings to ensure proper booting and network connectivity, and diagnose and troubleshoot errors.

  6. After completing all required operations in the server’s filesystem, exit the recovery environment.

    exit
    
  7. Unmount the BareMetal server filesystem:

    umount /dev/md125 /mnt
    

    Result:

    umount: /mnt: not mounted.
    
  8. Disable the virtual CD drive in the KVM console:

    1. Click the CD icon or select Media → Virtual Media Wizard... in the top menu of the KVM console window.
    2. In the window that opens, click Disconnect under CD/DVD Media1.
    3. Click Close.
  9. Restart the server:

    reboot
    

Useful linksUseful links

  • Using the Rescue CD diagnostics and recovery tools
  • Adding a new SSH key for a user
  • Restoring the OS bootloader
  • Replacing a disk in a RAID array

Was the article helpful?

Previous
Configuring the MC-LAG aggregation group
Next
Replacing a disk in a RAID array
© 2026 Direct Cursus Technology L.L.C.