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

推荐订阅源

小众软件
小众软件
A
About on SuperTechFans
博客园 - Franky
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 叶小钗
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
Last Week in AI
Last Week in AI
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
爱范儿
爱范儿
V
V2EX
G
Google Developers Blog

VPS主机

OVH VPS 产品线更新,推出新一代 2027 旧版价格上涨至少83% 知名VPS商家突然关停业务 大家赶紧申请退款 netcup VPS 6核8G 德国柏林 融合怪测评结果 2026年最新:NETCUP全系列值得买的项目机型+新人5€优惠券持续更新+免税账号注册教程 国内网站在线测速工具 VPS回程路由测试脚本:besttrace.sh 国内VPS服务器测速脚本:nench.sh 国外最受欢迎的VPS测速脚本:YABS NodeQuality VPS服务器测评脚本 VPS融合怪服务器测评脚本 谷歌云免费日本VPS测评 IP标段34.84.**.70 Racknerd VPS DC02迁移前后的性能网络对比
谷歌云开启root账户与密码登录
VPS专家 · 2026-05-28 · via VPS主机

VPS专家终身VIP VPS教程 阅读 5

最近很多撸GCP的,有的人不会改root登录,找到份教程分享给大家顺便给自己存个档

放心用!纯指令没有调用任何脚本,完全不用担心安全问题也不需要用任何脚本,像我这种用个别人的脚本都要下下来丢给ai查一遍有没有后门的人用这种最安心了 
在打开的网页版ssh登录界面,依次输入以下命令(复制以下命令,然后Ctrl+v 粘贴):

sudo sed -i 's/PermitRootLogin /#PermitRootLogin /g' /etc/ssh/sshd_config
sudo sed -i 's/PasswordAuthentication /#PasswordAuthentication /g' /etc/ssh/sshd_config
sudo sed -i 's/PermitEmptyPasswords /#PermitEmptyPasswords /g' /etc/ssh/sshd_config
echo "PermitRootLogin yes" | sudo tee -a /etc/ssh/sshd_config
echo "PasswordAuthentication yes" | sudo tee -a /etc/ssh/sshd_config
echo "PermitEmptyPasswords no" | sudo tee -a /etc/ssh/sshd_config
sudo systemctl restart sshd

生成随机密码:

cat /dev/urandom | tr -dc '_A-Z#-+=a-z(0-9%^>)]{<|' | head -c 20 ; echo ''
sudo passwd root

输入两次上面生成的随机密码,这个随机密码要保存好。这个就是登录root账户的密码。

原文来自:谷歌云开启root账户与密码登录

本文链接:https://www.vpszhuji.com/453.html,转载请注明出处。