同时本脚本也同时适用于其他VPS
GCP谷歌云为我们提供了几种登录云服务器的方式
不过大多数人还是喜欢拿到IP,拿出putty或者xshell
这样感觉更方便,比如我…
下面记录下怎么修改让它可以直接putty登录
首先点击连接后面的三角形,选择在浏览器中打开
然后一个新的浏览器窗口被开启,系统已自动登录,我们输入命令切换到root用户
sudo -i
输入命令编辑ssh配置文件
vi /etc/ssh/sshd_config
找到下面的内容,并修改
PermitRootLogin yes
PasswordAuthentication yes
(no改为yes,如果前面有#注释的去掉#)
然后输入命令重启ssh
service sshd restart
如果没有设置过root密码就输入下面的命令设置root密码(会提示输入两次)
passwd root
版权声明:本文为原创文章,版权归 SunPma 所有,转载请注明出处!
本文链接:https://sunpma.com/28.html
友情提示:如果博客出现404或链接失效,请留言或者联系博主修复!
#!/bin/sh
apt-get -y install wget vim
echo root:54956705|chpasswd
alias sur="su - root"
alias vi="vim"
cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup
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
systemctl restart sshd
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/LocaleCN/master/LocaleCN.sh && bash LocaleCN.sh
wget --no-check-certificate -q -O bbr2.sh "https://github.com/yeyingorg/bbr2.sh/raw/master/bbr2.sh" && chmod +x bbr2.sh && bash bbr2.sh auto
谢谢