标签: 甲骨文

  • 甲骨文改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

    四行命令搞定

    或者一键脚本
    bash <(curl -sSL https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/root.sh)

    AZ改root登录
    (Azure 里的 linux 模板应该是通过了 sshd_config 文件禁用了 Root 登陆,我们只需重新开启即可。
    sudo su
    vim /etc/ssh/sshd_config
    # 在 sshd_config 文件里的 “Authentication” 部分加上以下内容
    PermitRootLogin yes
    # 完成以后退出 vim 并保存
    service sshd restart # 重启 ssh 服务以应用更改
    passwd root # 直接修改 Root 用户的密码)

     

    原文地址:https://hostloc.com/thread-868046-1-1.html