甲骨文创建时没有设置密码密匙解决方案

[复制链接]
查看: 3325   回复: 2
发表于 2021-10-27 20:14:34 | 显示全部楼层 |阅读模式
按照我这篇忘记密码教程操作
https://hostloc.com/thread-859664-1-1.html


最后在加上开启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;


然后执行touch /.autorelabel

执行命令exec /sbin/init  启动操作系统
回复

使用道具 举报

发表于 2021-10-27 20:14:55 | 显示全部楼层
先收后藏
回复 支持 反对

使用道具 举报

发表于 2021-10-27 20:15:10 | 显示全部楼层
#编辑cloud.cfg
vim /etc/cloud/cloud.cfg
#在最后加入以下代码


#!/bin/bash
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

开机时候在填入代码放上也可以
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则