Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Compute Cloud
  • Getting started
    • Overview
    • Creating a Linux VM
    • Creating a Windows VM
    • Creating instance groups
  • Step-by-step instructions
    • All instructions
    • Creating VMs
      • Creating a Linux VM
      • Creating a Windows VM
      • Creating a VM from a set of disks
      • Create a VM with disks restored from snapshots
      • Creating a VM from a custom image
      • Creating a preemptible VM
      • Creating a VM with a GPU
    • DSVM
      • Overview
      • Creating a VM from a public DSVM image
    • Placement groups
      • Creating a placement group
      • Deleting a placement group
      • Creating a VM instance in a placement group
      • Adding a VM to a placement group
      • Removing a VM instance from a placement group
    • Images with pre-installed software
      • Creating a VM from a public image
      • Configuring software
      • Working with a VM based on a public image
      • Getting a list of public images
    • Getting information about a VM
      • Getting information about a VM
      • Viewing serial port output
    • Managing VMs
      • Stopping and starting a VM
      • Attaching a disk to a VM
      • Detaching a disk from a VM
      • Moving a VM to a different availability zone
      • Making a VM's public IP address static
      • Updating a VM
      • Changing VM computing resources
      • Deleting a VM
    • Working on VMs
      • Connecting to a VM via SSH
      • Connecting to a VM via RDP
      • Working with Yandex.Cloud from inside a VM
      • Installing NVIDIA drivers
    • Creating new disks
      • Creating an empty disk
    • Disk management
      • Creating a disk snapshot
      • Updating a disk
      • Deleting a disk
      • Deleting a disk snapshot
    • Creating new images
      • Uploading your image
    • Managing images
      • Deleting a disk image
    • Managing the serial console
      • Getting started
      • Connecting to a serial console via SSH
      • Connecting to a serial console via CLI
      • Start your terminal in the Windows SAC
      • Disabling access to the serial console
    • Creating instance groups
      • Creating a fixed-size instance group
      • Creating a fixed-size instance group with a load balancer
      • Creating an automatically scaled instance group
      • Creating an instance group from Container Optimized Image
    • Getting information about instance groups
      • Getting a list of groups
      • Getting information about a group
      • Getting a list of instances in a group
    • Managing instance groups
      • Update a group
      • Configure application health check on the VM
      • Update a group
        • Incremental update
        • Updating without downtime
      • Stop a group
      • Start a group
      • Delete a group
    • Dedicated hosts
      • Creating a VM in a group of dedicated hosts
      • Creating a VM on a dedicated host
  • Yandex Container Optimized Solutions
  • Scenarios
    • Configuring NTP time synchronization
    • Running instance groups with auto scaling
  • Concepts
    • Relationship between resources
    • Virtual machines
      • Overview
      • Platforms
      • vCPU performance levels
      • Graphics accelerators (GPUs)
      • Preemptible VMs
      • Network on a VM
      • Live migration
      • Placement groups
      • Statuses
      • Metadata
    • Disks
      • Overview
      • Disk snapshots
    • Images
    • Instance groups
      • Overview
      • Access
      • Instance template
      • Variables in an instance template
      • Policies
        • Overview
        • Allocation policy
        • Deployment policy
        • Scaling policy
      • Scaling types
      • Auto-healing
      • Update
        • Overview
        • Allocating instances across zones
        • Deployment algorithm
        • Rules for updating instance groups
      • Statuses
    • Dedicated host
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1 to May 1, 2019
  • Compute API reference
    • Authentication in the API
    • gRPC
      • Overview
      • DiskPlacementGroupService
      • DiskService
      • DiskTypeService
      • HostGroupService
      • HostTypeService
      • ImageService
      • InstanceService
      • PlacementGroupService
      • SnapshotService
      • ZoneService
      • InstanceGroupService
      • OperationService
    • REST
      • Overview
      • Disk
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • DiskPlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listDisks
        • listOperations
        • update
      • DiskType
        • Overview
        • get
        • list
      • HostGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listHosts
        • listInstances
        • listOperations
        • update
      • HostType
        • Overview
        • get
        • list
      • Image
        • Overview
        • create
        • delete
        • get
        • getLatestByFamily
        • list
        • listOperations
        • update
      • Instance
        • Overview
        • addOneToOneNat
        • attachDisk
        • create
        • delete
        • detachDisk
        • get
        • getSerialPortOutput
        • list
        • listOperations
        • removeOneToOneNat
        • restart
        • start
        • stop
        • update
        • updateMetadata
        • updateNetworkInterface
      • PlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listInstances
        • listOperations
        • update
      • Snapshot
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • Zone
        • Overview
        • get
        • list
      • Operation
        • Overview
        • get
      • InstanceGroup
        • Overview
        • createFromYaml
        • update
        • list
        • get
        • delete
        • start
        • stop
        • create
        • listAccessBindings
        • setAccessBindings
        • updateFromYaml
        • listLogRecords
        • listInstances
        • updateAccessBindings
        • listOperations
  • Questions and answers
    • General questions
    • Virtual machines
    • Disks and snapshots
    • Licensing
    • All questions on the same page
  1. Step-by-step instructions
  2. Managing the serial console
  3. Getting started

Getting started with the serial console

  • Before you start
  • Enabling the console when creating a VM from a public image
  • Enabling the console when updating a VM
  • Configuring a VM for serial port access
    • Linux
    • Windows

The serial console allows you to access a VM regardless of the network or OS status. For example, you can use the console for troubleshooting VM issues or when there are problems with SSH access.

Serial console access is disabled by default.

Warning

Assess the risk of enabling access via the serial console considering the following:

  • The user will be able to manage the VM from the internet even if there is no external IP address.

    To access the VM serial console from the Yandex.Cloud management console, the user must be authenticated in the Yandex.Cloud management console and have the proper rights to the VM. The user can also access the VM serial console from an SSH client application (such as PuTTY) or the YC CLI via SSH key authentication. In this regard, to reduce the risk of web session hijacking, the user needs to carefully monitor the SSH key and end the web session.

  • The session will be simultaneously shared by all users who have access to the serial console.

    Users will be able to see each other's actions when they're watching the serial console's output.

  • A valid session can be exploited by another user.

We recommend using the serial console only when absolutely necessary, grant access to a narrow group of people, and use strong VM passwords.
Make sure you disable access when you finish working with the serial console.

Federated users can only connect to the serial console using the CLI or SSH. These users can't access the serial console from the Yandex.Cloud management console.

Before you start

Before you enable serial console access on a VM:

  1. Prepare the key pair (public and private keys) for SSH access to the VM. The serial console authenticates users via SSH keys.

  2. Create a text file (for example, sshkeys.txt) and specify the following:

    <user name>:<user's public SSH key
    

    Example of a text file for yc-user:

    yc-user:ssh-rsa AAAAB3Nza......OjbSMRX yc-user@example.com
    

    By default, a user's SSH keys are stored in the ~/.ssh directory of this user. You can get a public key by running cat ~/.ssh/<public key name>.pub.

Enabling the console when creating a VM from a public image

To enable access to the serial console when creating a VM, set the serial-port-enable parameter in metadata to 1.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

Linux
Windows
  1. View the description of the CLI command for creating a VM:

    $ yc compute instance create --help
    
  2. Select a public image based on the Linux OS (such as Ubuntu).

    To get a list of available images, run the following command:

    yc compute image list --folder-id standard-images
    

    Command execution result:

    +----------------------+-------------------------------------+--------------------------+----------------------+--------+
    |          ID          |                NAME                 |          FAMILY          |     PRODUCT IDS      | STATUS |
    +----------------------+-------------------------------------+--------------------------+----------------------+--------+
    ...
    | fdvk34al8k5nltb58shr | centos-7-1549279494                 | centos-7                 | dqni65lfhvv2den5gtv9 | READY  |
    | fdv7ooobjfl3ts9gqp0q | windows-2016-gvlk-1548913814        | windows-2016-gvlk        | dqnnc72gj2ist3ktjj1p | READY  |
    | fdv4f5kv5cvf3ohu4flt | ubuntu-1604-lts-1549457823          | ubuntu-1604-lts          | dqnnb6dc7640c5i968ro | READY  |
    ...
    +----------------------+-------------------------------------+--------------------------+----------------------+--------+
    
  3. Create a VM in the default folder:

    $ yc compute instance create \
        --name first-instance \
        --zone ru-central1-a \
        --network-interface subnet-name=default-a,nat-ip-version=ipv4 \
        --create-boot-disk image-folder-id=standard-images,image-family=ubuntu-1604-lts \
        --metadata-from-file ssh-keys=sshkeys.txt \
        --ssh-key ~/.ssh/<public key name>.pub \
        --metadata serial-port-enable=1
    

    This command creates the VM:

    • With Ubuntu.
    • Named first-instance.
    • In the ru-central1-a zone.
    • With the serial console active.

    A user named yc-user will be automatically created in the VM's OS with the specified public key.

  1. View the description of the CLI command for creating a VM:

    $ yc compute instance create --help
    
  2. Select a public image for Windows.

    To get a list of available images, run the following command:

    yc compute image list --folder-id standard-images
    

    Command execution result:

    +----------------------+-------------------------------------+--------------------------+----------------------+--------+
    |          ID          |                NAME                 |          FAMILY          |     PRODUCT IDS      | STATUS |
    +----------------------+-------------------------------------+--------------------------+----------------------+--------+
    ...
    | fdvk34al8k5nltb58shr | centos-7-1549279494                 | centos-7                 | dqni65lfhvv2den5gtv9 | READY  |
    | fdv7ooobjfl3ts9gqp0q | windows-2016-gvlk-1548913814        | windows-2016-gvlk        | dqnnc72gj2ist3ktjj1p | READY  |
    | fdv4f5kv5cvf3ohu4flt | ubuntu-1604-lts-1549457823          | ubuntu-1604-lts          | dqnnb6dc7640c5i968ro | READY  |
    ...
    +----------------------+-------------------------------------+--------------------------+----------------------+--------+
    
  3. Create a VM in the default folder:

    $ yc compute instance create \
    --name win-instance \
    --metadata-from-file user-data=metadata.yaml \
    --zone ru-central1-c \
    --network-interface subnet-name=default-c,nat-ip-version=ipv4 \
    --create-boot-disk image-folder-id=standard-images,image-family=windows-2016-gvlk \
    --metadata serial-port-enable=1
    

    This command creates the VM:

    • With Windows.
    • Named win-instance.
    • In the ru-central1-c zone.
    • With the serial console active.

    The Administrator user with the password specified in the metadata.yaml file will be automatically created in the OS.

Enabling the console when updating a VM

To enable access to the serial console when editing the VM settings, set the serial-port-enable parameter in metadata to 1.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. Get a list of VMs in the default folder:

    $ yc compute instance list
    +----------------------+-----------------+---------------+---------+----------------------+
    |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
    +----------------------+-----------------+---------------+---------+----------------------+
    | fhm0b28lgfp4tkoa3jl6 | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
    | fhm9gk85nj7gcoji2f8s | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
    +----------------------+-----------------+---------------+---------+----------------------+
    
  2. Select the VM ID or NAME (for example, first-instance).

  3. Set serial-port-enable=1 in the VM metadata:

    $ yc compute instance add-metadata \
        --name first-instance \
        --metadata serial-port-enable=1
    

    This command will start activating the serial console on the machine named first-instance.

Configuring a VM for serial port access

For the serial console to be available from the operating system, the OS must be configured accordingly:

  • Linux
  • Windows

Linux

To connect to the Linux serial console, make sure that SSH password authentication is disabled and, if necessary, set a password for the appropriate OS user.

Disable SSH password authentication

Note

SSH connections using a login and password are disabled by default on public Linux images that are provided by Yandex.Cloud.

If you use your own image, make sure that SSH access with your username and password is disabled.

To disable SSH password authentication:

  1. Open the configuration file on the SSH server (/etc/ssh/sshd_config by default). Only a superuser has read and write access to the file.

  2. Set the PasswordAuthentication option to no.

  3. Restart the SSH server:

    $ sudo systemctl restart ssh
    

Create a password for a Linux user

Some operating systems may request user data to access the VM. Before connecting to these machines, create a local password for the default user.

To create a local password, use the CLI.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. Get a list of VMs in the default folder:

    $ yc compute instance list
    +----------------------+-----------------+---------------+---------+----------------------+
    |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
    +----------------------+-----------------+---------------+---------+----------------------+
    | fhm0b28lgfp4tkoa3jl6 | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
    | fhm9gk85nj7gcoji2f8s | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
    +----------------------+-----------------+---------------+---------+----------------------+
    
  2. Select the VM ID or NAME (for example, first-instance).

  3. Get the VM's public IP address.

    $ yc compute instance get first-instance
    

    In the command output, find the address of the VM in the one_to_one_nat section:

    ...
    one_to_one_nat:
        address: <public IP address>
        ip_version: IPV4
    ...
    
  4. Connect to the VM. For more information, see Connecting to a VM.

  5. Create a local password. In Linux, you can set a password using the passwd command:

    $ sudo passwd <user name>
    

    Example for yc-user:

    $ sudo passwd yc-user
    
  6. Terminate the SSH session with the exit command.

Windows

An equivalent of the serial console in Windows is the Speicial Administration Console (SAC).

Note

If you created your VM after February 22, 2019, you don't need to configure anything else: the SAC is enabled by default.

If you created it before February 22, 2019, you need to update the Windows registry to connect to the SAC:

  1. Connect to the VM over RDP.

  2. To do this, run cmd or PowerShell and execute the following commands:

    $ bcdedit /ems "{current}" on
    The operation completed successfully.
    
    $ bcdedit /emssettings EMSPORT:2 EMSBAUDRATE:115200
    The operation completed successfully.
    
  3. Restart the VM.

In this article:
  • Before you start
  • Enabling the console when creating a VM from a public image
  • Enabling the console when updating a VM
  • Configuring a VM for serial port access
  • Linux
  • Windows
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC