zhanguang
V2EX  ›  Google

小白问题,求助 google shell 如何用 xshell 登录?谢谢

  •  
  •   zhanguang · Mar 15, 2020 via Android · 5690 views
    This topic created in 2427 days ago, the information mentioned may be changed or developed.
    我是个人用的,不懂技术,希望有能出教程的大神给予帮忙。感谢万分!
    7 replies  •  2020-03-15 15:47:45 +08:00
    jeblur
    jeblur
    Mar 15, 2020
    1
    你说的 google shell 指的是 google 云平台中登录服务器用的 web 版的 shell ?如果是的话你只需要知道你的服务器的公网 ip 和私钥文件,并且在 xshell 的新建连接中添加 ip 地址和私钥文件就可以正常登录了。
    dr90s
    dr90s
    Mar 15, 2020
    2
    xshell 生成一个密钥 把要登陆的用户名和公钥添加到 google cloud 的实例设置里面
    dr90s
    dr90s
    Mar 15, 2020
    3
    提问之前先查一下吧 教程很多的
    abbottcn
    abbottcn
    Mar 15, 2020 via iPhone
    4
    sudo -i
    passwd

    Enable root login in sshd config.

    Or use key.

    Enable firewall rules.
    Copy the IP address of your instance.
    xiebruce
    xiebruce
    Mar 15, 2020
    5
    用 xshell 登录那肯定就是登录 linux 服务器了,所以你这个问题其实就是“如何用命令登录 Linux 服务器”,这跟你是否用 xshell 无关,跟 xshell 类似的软件还有很多(比如 putty, git bash, 又比如 win10 自带的 windows powershell 和微软新开发的 windows terminal),这跟你要登录的是否是 google cloud 也无关,只要是 linux 服务器都一样,你搜索一下“怎样使用 ssh 登录远程服务器”一堆答案出来,我这里给你一个最简单的,输入“ssh 用户名 @ip”回车,会提示你输入 yes 或 no,你输入 yes 再回车,就会让你输入密码了,举例“ssh [email protected]”,至于怎样免密码登录,可以看这篇文章: https://www.xiebruce.top/583.html
    C7cSolli
    C7cSolli
    Mar 15, 2020❤️2
    6
    在 gce 网页端 ssh 先登录进去
    然后输入
    sudo -i
    接着输入
    vi /etc/ssh/sshd_config
    然后按键盘 ins 键或者 i 键。
    找到 PermitRootLogin 和 Pa sswordAuthentication

    把"no“ 改成”yes"

    然后按一下 ESC 键,输入 :wq! (冒号 达不纽和 kiu 再加上一个英文叹号)
    接着,输入
    passwd root
    输入两次你要设置的密码。

    然后重启 ssh 服务。
    CentOS 命令:systemctl restart sshd.service
    Ubuntu/Debian 命令:/etc/init.d/ssh restart

    ············
    在你的本地 xshell 或者 putty 终端中,填入你的 IP,用户名:root
    密码,就是你设置的那个。
    Over~~~
    thxv2
    thxv2
    Mar 15, 2020 via Android
    7
    @C7cSolli 你这个回答靠谱 ♥
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1756 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 15:55 · PVG 23:55 · LAX 07:55 · JFK 10:55
    ♥ Do have faith in what you're doing.