Azure Lei Zhang的博客

weibo: LeiZhang的微博/QQ: 185165016/QQ群:319036205/邮箱:leizhang1984@outlook.com/TeL:139-161-22926

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  489 随笔 :: 0 文章 :: 417 评论 :: 70万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

  《Windows Azure Platform 系列文章目录

 

  Azure虚拟机为了安全考虑,默认是禁止root账户的。

  如果我们需要启用root的密码登录,需要执行下面的操作。

  1.我们首先新建一台Linux VM,操作系统选择Rocky 9。

  2.编辑SSH配置文件

vi /etc/ssh/sshd_config

  3.找到一下配置并进行修改

  • PermitRootLogin:设置为 yes 以允许 root 用户登录。
  • PasswordAuthentication:确保设置为 yes 以允许密码认证。
PermitRootLogin yes
PasswordAuthentication yes

  

  4.特别注意,如果你第一次创建虚拟机的时候,默认创建的用户是通过SSH Key登录的,还要修改下面的内容

vi /etc/ssh/sshd_config.d/50-cloud-init.conf

  把50-cloud-init.conf里面的配置PasswordAuthentication设置为yes

PasswordAuthentication yes

  如果你第一次创建虚拟机的时候,默认创建的登录用户是用户名+密码的,则不需要修改 50-cloud-init.conf

 

  5.重启SSH服务,或者重启虚拟机

sudo systemctl restart sshd

 

  6.最后可以通过命令

ssh root@Azure虚拟机IP

  随后输入密码,直接登录到这台虚拟机上

 

posted on   Lei Zhang的博客  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2014-01-23 [SDK2.2]Windows Azure Virtual Network (5) 重启、关闭、开启VNet中Virtual Machine
2012-01-23 Windows Azure Storage (7) 使用工具管理Windows Azure Storage
点击右上角即可分享
微信分享提示