惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

思有云 - IOIOX - Oracle

甲骨文云 Oracle Cloud 服务器防回收保活 docker 命令 - 思有云 甲骨文云 Oracle Cloud 引导卷扩展和块存储卷挂载 - 思有云 甲骨文云 Oracle Cloud 解决 ARM 服务器安装军哥 LNMP 环境的几个问题 - 思有云 甲骨文云 Oracle Cloud 能创建几台免费服务器? - 思有云 甲骨文云 Oracle Cloud 免费 ARM 实例关于引导卷扩容 yum docker BBR 等相关解决方案 - 思有云 Oracle Cloud VPS CentOS 7 升级内核并开启官方原版BBR加速 - 思有云
Oracle Cloud VPS CentOS 7 修改主机名,BBR 失联,root 登录等注意事项. - 思有云
博主: Stille · 2020-05-06 · via 思有云 - IOIOX - Oracle

前言

折腾使用 Oracle Cloud 的免费 VPS 已有半年之久.由于奇葩的甲骨文云面板既无快照功能,重装又麻烦,经过不停的删机,抢机,最后也算是稳定的配置好了服务器.本文将简单总结和分享下在配置奇葩的甲骨文CentOS 7时遇到的一些问题和解决方法.

本文为 Stille 原创文章.经实践,测试,整理发布.如需转载请联系作者获得授权,并注明转载地址.


解决方案

登录问题

虽然 Oracle 默认使用了SSK KEY的验证模式来登录 VPS ,同时关闭了root帐号登录方式.但有些场景还是需要使用账号密码来直接登录root账号.在加上网络问题导致经常遇到断开终端的情况,参考以下参数来进行配置.

切换至 root 创建密码

sudo -i
# 切换至 root 账号
passwd
# 修改密码

修改登录配置

vi /etc/ssh/sshd_config
# 编辑 sshd_config

添加或修改Port 22222以确保SSH端口安全.
查找到#PermitRootLogin yes,去掉#注释符号.
查找到#PasswordAuthentication yes,去掉#注释符号.
查找到#ClientAliveInterval 0,去掉#注释符号,0改为30.
查找到#MaxSessions 10,去掉#注释符号.

systemctl restart sshd
# 重启 sshd 生效

防火墙

由于甲骨文云有控制台可以配置安全防火墙,加上修改了SSH端口,可以禁用防火墙,使用iptables来管理.

systemctl stop firewalld
systemctl disable firewalld

修改主机名

甲骨文云的CentOS 7在使用hostnamectl set-hostname命令修改主机名时,重启服务器后依旧会恢复为 Web 端创建实例时所设置的名字.网上查找了各种方法都无效,最终找到了解决方案.

编辑修改oci-hostname.conf文件

vi /etc/oci-hostname.conf

PRESERVE_HOSTINFO=0中的的值0修改为1

# This configuration file controls the hostname persistence behavior for Oracle Linux
# compute instance on Oracle Cloud Infrastructure (formerly Baremetal Cloud Services)
# Set PRESERVE_HOSTINFO to one of the following values
#   0 -- default behavior to update hostname, /etc/hosts and /etc/resolv.conf to 
#        reflect the hostname set during instance creation from the metadata service
#   1 -- preserve user configured hostname across reboots; update /etc/hosts and 
#           /etc/resolv.conf from the metadata service  
#   2 -- preserve user configured hostname across instance reboots; no custom  
#        changes to /etc/hosts and /etc/resolv.conf from the metadata service,
#        but dhclient will still overwrite /etc/resolv.conf
#   3 -- preserve hostname and /etc/hosts entries across instance reboots; 
#        update /etc/resolv.conf from instance metadata service
PRESERVE_HOSTINFO=0

使用hostnamectl set-hostname命令修改主机名即可.重启也不会失效.

hostnamectl set-hostname xxxxxx

BBR 注意事项

甲骨文云的CentOS 7系统也比较奇葩,使用各种BBRPlus脚本都会遇到每天一失联的情况,还必须在后台重启.只有使用原版 BBR,但是随着内核的升级,目前最新版内核会导致无法启动.经过多次尝试最终只有手动安装5.3.13版内核,并在yum的更新配置中忽略不升级内核,才能稳定运行.详细安装方法参考以下链接:

卸载相关程序

rpcbind

使用netstat -ntlp命令发现rpcbind监听了111端口,如担心安全可执行以下命令卸载禁用:

systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl disable rpcbind
systemctl disable rpcbind.socket 

oracle-cloud-agent

卸载甲骨文云官方后台监控程序

systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater

结语

无话可说...奇葩甲骨文你行的...

韩国 GIA 真香


晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. 晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。
RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。

赞赏作者

如果喜欢我的文章,觉得对你有帮助,请随意赞赏!