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 create a VM with password access

How to create a VM with password access

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

Scenario descriptionScenario description

You need to create a VM instance with password access.

SolutionSolution

In the public Linux images provided by Yandex Cloud, the option to connect via SSH using a login and password is disabled by default. You can enable it either from within your VM or when creating a VM based on metadata.

For more about VM metadata, see the documentation.

Alert

Please note that connecting with a login and password is less secure than connecting with a key pair.

Example of metadata to create a username user with the 12345678 password:

#cloud-config
datasource:
 Ec2:
  strict_id: false
ssh_pwauth: yes
users:
  - name: username
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
chpasswd:
  list: |
     username:12345678
  expire: False

You can deliver metadata when creating a VM using the CLI, API, or Terraform. Example of a CLI command:

yc compute instance create  --name instance --zone ru-central1-a \
--network-interface subnet-name=default-ru-central1-a,nat-ip-version=ipv4 \
--create-boot-disk image-folder-id=standard-images,image-family=ubuntu-2204-lts \
--metadata-from-file user-data=metadata.yaml

Was the article helpful?

Previous
What is the disk access speed for a VM
Next
What is the maximum number of network interfaces that can be connected to a VM
Yandex project
© 2025 Yandex.Cloud LLC