Registrieren Anmelden
n/program · 2024-05-31 · 463 Aufrufe
u/mxg123Silber
n/programu/mxg123 · 2024-05-31

GCP更改root并密码登录我自己用的方法不行,谁有其他办法

sudo -i切换到root

passwd设置密码

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

reboot重启服务器
我自己执行这六条命令后不能登录FinalShell,求个其他办法或者谁知道这是什么问题?

0
8
Anmelden, um mitzudiskutieren.
海外原生IP VPS,稳定访问全球网络

还在为IP不纯、平台风控、频繁验证而烦恼? 丽萨主机海外原生IP VPS,双ISP住宅IP,覆盖美国、香港、日本、新加坡、台湾、德国、越南、英国等热门地区,适合跨境电商、社媒运营、AI工具、流媒体及海外业务使用。

lisahost.com Mehr erfahren

8 Antworten

Sortierung
  1. mxg123 Silber OP 2024-05-31

    ["\u66f4\u6539root\u5e76\u7528\u5bc6\u7801\u767b\u5f55\u6211\u81ea\u5df1\u7528\u7684\u65b9\u6cd5\u4e0d\u884c\uff0c\u8c01\u6709\u5176\u4ed6\u529e\u6cd5","GCP\u66f4\u6539root\u5e76\u5bc6\u7801\u767b\u5f55\u6211\u81ea\u5df1\u7528\u7684\u65b9\u6cd5\u4e0d\u884c\uff0c\u8c01\u6709\u5176\u4ed6\u529e\u6cd5"]

    0
  2. fengzai Ehrenmoderator Meister 2024-05-31

    [[10,21],[2,10]]

    0
  3. nsvusnt Silber 2024-05-31

    @"mxg123"#p33150 GCP?什么系统?看他们回复乌班图好像不行,debina系统就没问题。

    0
  4. Linux Gold 3 JAHRE 2024-05-31

    加这个命令行
    </s>rm -rf /etc/ssh/sshd_config.d/* &amp;&amp; rm -rf /etc/ssh/ssh_config.d/*<br/> /etc/init.d/ssh* restart<e>

    0
  5. mxg123 Silber OP 2024-05-31

    @"nsvusnt"#p33163 是呢,换系统就好了

    0
  6. awinds Gold Nie verlassen 2024-05-31

    一键ROOT
    wget -q root.sh https://raw.githubusercontent.com/passeway/root/main/root.sh && chmod +x root.sh && ./root.sh

    0
  7. fengzai Ehrenmoderator Meister 2024-06-01

    @"mxg123"#p33172 问题解决了可以选择一下最佳的回复

    0
  8. blue202 Silber 2024-06-03

    DD几分钟的事 很快

    0