服务器运维之家
    • 服务器运维之家
    服务器运维之家
    • 首页
    • 服务器运维
      • Linux技巧
      • Linux教程
      • 环境搭建
      • 运维编程
      • Windows系统
    • DNS/CDN相关
    • VPS优惠
      • 韩国VPS
      • 香港VPS
      • 美国VPS
    • 域名
    • 白嫖的知识
    • 工具干货
    • 网站主题
      • WordPress
      • Typecho
    • 开源代码
    服务器运维之家
    首页 » 白嫖的知识 » Azure如何启用root用户登录
    白嫖的知识

    Azure如何启用root用户登录

    2022年08月09日
    收录于话题
    #azure #az

    默认情况下 azure的虚拟机是没有root权限的,可以通过如下的步骤来实现

    sudo su

    vi /etc/ssh/sshd_config

    在 sshd_config 文件里的 “Authentication” 部分加上以下内容

    PermitRootLogin yes

    完成以后退出 vi 并保存

    service sshd restart # 重启 ssh 服务以应用更改

    passwd root # 直接修改 Root 用户的密码

    也可以直接复制以下代码修改,其中密码设置替换成自己要改的密码,之后就能用root和你才设置的密码登陆了。

    echo root:密码设置 |sudo chpasswd root
    sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
    sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
    sudo service sshd restart


    Azure如何启用root用户登录
    下一篇 Chrome取消关闭隐藏www https方法,Chrome恢复显示www设置

    相关信息

    Chrome取消关闭隐藏www https方法,Chrome恢复显示ww ...

    2022年08月14日

    热门推荐信息

    Chrome取消关闭隐藏www https方法,Chrome恢复显示www设置

    2022年08月14日

    Chrome取消关闭隐藏www 和https方法,Chrome恢复显示www设置

    最新内容

    Chrome取消关闭隐藏www https方法,Chrome恢复显示www设置

    2022年08月14日
    文章导航
    关于本站
    服务器运维之家

    服务器运维,VPS运维,VPS选择,云主机选择,Linux命令

    © 2025 服务器运维之家.
    • 联系我们
    • 返回首页

    按 回车 搜索. 按 Esc 取消.