V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhanguang
V2EX  ›  Google

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

  •  
  •   zhanguang · 2020-03-15 10:22:44 +08:00 via Android · 4182 次点击
    这是一个创建于 1496 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我是个人用的,不懂技术,希望有能出教程的大神给予帮忙。感谢万分!
    7 条回复    2020-03-15 15:47:45 +08:00
    jeblur
        1
    jeblur  
       2020-03-15 11:10:47 +08:00
    你说的 google shell 指的是 google 云平台中登录服务器用的 web 版的 shell ?如果是的话你只需要知道你的服务器的公网 ip 和私钥文件,并且在 xshell 的新建连接中添加 ip 地址和私钥文件就可以正常登录了。
    dr90s
        2
    dr90s  
       2020-03-15 11:43:10 +08:00
    xshell 生成一个密钥 把要登陆的用户名和公钥添加到 google cloud 的实例设置里面
    dr90s
        3
    dr90s  
       2020-03-15 11:45:01 +08:00
    提问之前先查一下吧 教程很多的
    abbottcn
        4
    abbottcn  
       2020-03-15 11:47:06 +08:00 via iPhone
    sudo -i
    passwd

    Enable root login in sshd config.

    Or use key.

    Enable firewall rules.
    Copy the IP address of your instance.
    xiebruce
        5
    xiebruce  
       2020-03-15 14:07:15 +08:00
    用 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
        6
    C7cSolli  
       2020-03-15 14:11:12 +08:00   ❤️ 2
    在 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
        7
    thxv2  
       2020-03-15 15:47:45 +08:00 via Android
    @C7cSolli 你这个回答靠谱 ♥
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2285 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:55 · PVG 08:55 · LAX 17:55 · JFK 20:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.