如何在无头远程服务器上登录"firebase-tools"? [英] How to login to `firebase-tools` on headless remote server?

查看:98
本文介绍了如何在无头远程服务器上登录"firebase-tools"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Putty在远程Linux服务器上使用firebase-tools.此服务器上没有正在运行的桌面.

I am attempting to use firebase-tools on a remote Linux server via Putty. There is no desktop running on this server.

当我运行firebase login时,会出现一个长网址,我需要将其复制/粘贴到任何其他设备的浏览器中:

When I run firebase login, I'm presented with a long url that I need to copy/paste into any other device's browser:

https://accounts.google.com/o/oauth2/auth?client_id=xxxxxxxxxxxx.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=3kkd93kl&redirect_uri=http%3A%2F%2Flocalhost%3A9005

我将其复制/粘贴到本地计算机上的浏览器中,然后使用我的Google帐户进行身份验证,然后尝试将我重定向到

I copy/paste this into the browser on my local machine, then I authenticate with my Google account, then it attempts to redirect me to

http://localhost:9005/?state=25744816&code=4/mz.....

这不是我的计算机上运行的实际服务器,而且绝对不是远程计算机的地址,该远程计算机甚至没有激活9005端口.

which is not an actual server running on my machine and is defintely not the address to the remote machine, which doesn't even have port 9005 active.

结果是终端仍然坐在等待认证..."

So the result is that the terminal is still sitting at "Waiting for authentication..."

我看到了一个名为login:ci的命令,该命令说它适用于非交互式环境,但它似乎与login命令具有相同的作用.

I see a command called login:ci which says its for non-interactive environments, but it appears to do the same thing as the login command.

如何解决这个问题?

推荐答案

您可以使用firebase login --no-localhost

然后它将提示您可以从任何浏览器(无论是计算机)还是主机访问的URL.

It will then prompt a url you can visit from any browser (no matter the machine), like your host.

照常使用您的Google帐户登录并接受许可请求.

Log in with your Google account as usual and accept the permission request.

最后,复制提供的授权码

并将其粘贴回远程计算机的终端中.您应该会收到一条成功消息.

And paste it back in your remote machine's terminal. You should get a success message.

这篇关于如何在无头远程服务器上登录"firebase-tools"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆