如何使用Azure中的串行控制台连接到VM

mwkjh3gx  于 2023-03-31  发布在  其他
关注(0)|答案(1)|浏览(195)

1.创建了另一个帖子,其中。pem文件有权限问题,在工作了一整天后,它突然停止让我。ssh进入
1.创建了4个虚拟机,但没有使用ssh从我的机器到虚拟机
1.已开始通过串行控制台连接(正常工作)
1.在服务器上搞砸了,站起来了第五个盒子
1.尝试通过串行控制台访问
1.提示输入密码
1.从未创建密码
1.重置密码
错误:

(VMExtensionProvisioningError) VM has reported a failure when processing extension 'enablevmaccess'. Error message: "Enable failed: Failed to generate public key file."

More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot 
Code: VMExtensionProvisioningError
Message: VM has reported a failure when processing extension 'enablevmaccess'. Error message: "Enable failed: Failed to generate public key file."

More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot

我的问题是:
我该如何:
1.使用ssh本地连接到Azure VM
1.通过门户a中的Azure串行控制台连接。必须首先为用户设置密码

68de4m5k

68de4m5k1#

将SSH连接到Azure VM,我遵循了以下步骤:
在创建虚拟机时,您可以使用用户名和密码,并选择入站端口规则为SSH(22),如下所示:

要在终端中连接SSH,请使用ssh用户名@yourpublicip

ssh username@20.164.215.XXX

输出

Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-1104-azure x86_64)
* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

 System information as of Mon Mar 27 06:38:39 UTC 2023
 System load:  0.4               Processes:           112
 Usage of /:   4.5% of 28.89GB   Users logged in:     0
 Memory usage: 5%                IP address for eth0: 10.2.0.4
 Swap usage:   0%
 
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

确保在您的***VM -〉网络-〉入站端口规则中允许SSH 22***,如下所示:

我尝试使用串口控制台登录,在Vm -〉串口控制台-〉只有用户名和密码,它的登录成功如下:

输出

Ubuntu 18.04.6 LTS testvm1 ttyS0

testvm1 login: Imran123
Password: 
Last login: Mon Mar 27 06:38:41 UTC 2023 from 49.207.213.83 on pts/0
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-1104-azure x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Mar 27 06:45:45 UTC 2023

  System load:  0.0               Processes:           107
  Usage of /:   4.6% of 28.89GB   Users logged in:     1
  Memory usage: 6%                IP address for eth0: 10.2.0.4
  Swap usage:   0%

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

New release '20.04.6 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Imran123@testvm1:~$ 2023/03/27 06:52:22.661338 INFO Daemon Agent WALinuxAgent-2.9.0.4 launched with command 'python3 -u bin/WALinuxAgent-2.9.0.4-py2.7.egg -run-exthandlers' is successfully running

要在虚拟机中重置密码,请执行以下操作:

参考

Create and use an SSH key pair for Linux VMs in Azure - Azure Virtual Machines | Microsoft Learn

相关问题