全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 468|回复: 2

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

[复制链接]
发表于 2021-9-25 20:24:05 | 显示全部楼层 |阅读模式
按照我这篇忘记密码教程操作
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-9-25 20:36:23 | 显示全部楼层
#编辑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

开机时候在填入代码放上也可以
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-20 18:02 , Processed in 0.061043 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表