Administrator
发布于 2026-03-26 / 4 阅读

Linux

★ORACLE修改密码登录★

1.临时权限:【sudo su】、【cd /root】

2.编辑ssh配置文件:【nano /etc/ssh/sshd_config】

(1)注释掉这行“Include /etc/ssh/sshd_config.d/*.conf”

结果“#Include /etc/ssh/sshd_config.d/*.conf”

(2)找到PermitRootLogin,把前面的#去掉,改成PermitRootLogin yes

(3)找到PasswordAuthentication,把前面的#去掉,改成PasswordAuthentication yes

(4)“PubkeyAuthentication”为密钥登录,可注释#,可设置为PubkeyAuthentication no

总之确保以下几项:

PermitRootLogin yes #允许root登录

PasswordAuthentication yes #允许密码登录

KbdInteractiveAuthentication no #关闭可替代密码输入的交互式方式

ChallengeResponseAuthentication no #关闭复杂的二次响应式认证

UsePAM yes #启用Linux系统的完整认证框架

【可不选】附加:修改authorized_keys文件(即ssh证书)

【vi .ssh/authorized_keys】

(执行后跳出5行代码,按键盘字母“i”键,接着仅按光标键“-->”右移,移至ssh-rsa,按删除键删除前面全部,使ssh-rsa顶格,接着按“esc”,然后按住“shift”+“:”冒号,出现光标,输入“wq”, 然后回车)

3.修改完后,按“ctrl+X”保存退出、选择y、 然后回车;必须接着设置密码

4.重置SSHD【service sshd restart】

设密两次【passwd】

户名root 密码联机

(1)查机【hostnamectl】

(2)"DD"脚本

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p 123456 -port 55 #版本密码端口

(3)更新

【apt update -y && apt install -y curl && apt install -y socat && apt install wget -y】

(4)改机名

apt-get install sudo #安sudo

hostnamectl set-hostname XY #改XY

(5)改时间

timedatectl #查看

timedatectl set-timezone Asia/Shanghai #上海

(6)增内存swap

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh #选择"18"

(7)开BBRplus(选"No")

【wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh】

(8)kejilion脚本

curl -sS -O https://raw.githubusercontent.com/kejilion/sh/main/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh #GitHub

一、获取root权限

1.【sudo -i】临时root

Debian/CentOS通用

【sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config】

【sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config】

Ubuntu自用

【sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config】

【sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config】

2.【service sshd restart】重置SSHD

3.【passwd】设密两次

4. 户名root 密码联机

二、安装XUI

1.更新环境

Debian/Ubuntu命令

【apt update -y && apt install -y curl && apt install -y socat && apt install wget -y】

CentOS命令

【yum update -y && yum update -y && yum install -y socat】

2.端口放行(iptables -L)

Debian/Ubuntu命令

(1)无iptables先安装;通常系统自带;

【apt-get update】

【apt-get install iptables】

-----------------------------

(2)已自带iptables,以下2种开启方式

第①种:开启所有端口

iptables -P INPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -P OUTPUT ACCEPT

iptables -F

iptables-save

第②种:开启指定端口(如:80)

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

iptables-save

------------------------------

(3)安装iptables-persistent

【apt-get install iptables-persistent】

保存规则持续生效(2条命令)

【netfilter-persistent save】

【netfilter-persistent reload】

------------------------------

(4)关闭防火墙或删除

【apt-get purge netfilter-persistent】#关闭

【reboot】#重启

【rm -rf /etc/iptables && reboot】#删除

CentOS命令

firewall-cmd --zone=public --add-port=443/tcp --permanent #放行443端口

firewall-cmd --reload #重启防火墙

firewall-cmd --query-port=443/tcp #查看443端口是否开启

firewall-cmd --list-ports #查看已开端口

---------------------------------------------------

【firewall-cmd --state】#查看防火墙状态

【systemctl stop firewalld.service】#停止防火墙

【systemctl disable firewalld.service】#禁止防火墙开机启动

【service iptables stop】#关闭iptables

【chkconfig iptables off】#去掉iptables开机启动

3.运行Acme

curl https://get.acme.sh | sh

4.登记邮箱

~/.acme.sh/acme.sh --register-account -m sina@gmail.com

5.申请证书

~/.acme.sh/acme.sh --issue -d cxyxz.tk --standalone

(不成功、打开80端口;或更换“组织”)↓

【~/.acme.sh --set-default-ca --server letsencrypt】换Encrypt,再申请↑

【~/.acme.sh --set-default-ca --server buypass】换Buypass,再申请↑

【~/.acme.sh --set-default-ca --server zerossl】换ZeroSSL默认,再申请↑

6.下载证书

~/.acme.sh/acme.sh --installcert -d cxyxz.tk --key-file /root/private.key --fullchain-file /root/cert.crt

公钥【/root/cert.crt】

密钥【/root/private.key】

更新证书

【~/.acme.sh/acme.sh --issue -d cxyxz.tk --upgrade】

7.安装XUI

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh) #原版

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh) #改版

三、原版BBR

查看BBR开启状态: sysctl -p

查看BBR内核版本: uname -r

开启自带BBR加速代码如下:

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf

echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

sysctl -p

lsmod | grep bbr #显20480