甬哥:获取VPS的root权限,随意更改root密码的一键脚本及修改ssh端口

教程类 · 2022-10-16

一、更改root密码的一键脚本

wget -N https://gitlab.com/rwkgyg/vpsroot/raw/main/root.sh && bash root.sh 

用户名:root,密码必须自定义。

登录SSH时,请更改原用户名为root,并输入自定义密码!

提示:密码不要设置得过于简单(纯数字),容易被破解。如有密钥文件要保存好,以防万一!

目前已测试支持的VPS如下:

Euserv德鸡,Hax IPV6,甲骨文oracle、谷歌云gpc、IBM Linux one、亚马逊云azurz

二:修改ssh端口

1、编辑sshd_config

nano /etc/ssh/sshd_config

2、找到:Include /etc/ssh/sshd_config.d/*.conf
在“Include /etc/ssh/sshd_config.d/*.conf“”下面添加两行
port 22
port 33(随意设定端口别冲突就行,2-4位数都可以)

3、在"Include /etc/ssh/sshd_config.d/*.conf"前面加#号

Ctrl+x
y
保存

4、重启vps

5、使用新加的端口号登录

6、登录成功后按上面步骤重新操作,在“port 22”前加#

7、重启vps

8、查看变更状态
systemctl status sshd

成功

取消回复
  1. 1 2023-10-20

    555

  2. 1 2023-10-20

    1

  3. 1 2023-10-20

    1

    1. 1 2023-10-20
      @1

      555

    2. 1 2023-10-20
      @1

      1

  4. 1 2023-10-20

    1

    1. 1 2023-10-20
      @1

      555

    2. 1 2023-10-20
      @1

      1

  5. 1 2023-10-19

    555

    1. 1 2023-10-20
      @1

      1

    2. 1 2023-10-20
      @1

      1

Theme Jasmine by Kent Liao