How to complete a browser flow over SSH

Tuesday, the 24th of February 2026

This is useful in cases where you are on another machine via SSH and want to forward a local listener that usually only listens on localhost (e.g. gcloud auth login).

ssh <-f> -N -L <local_port>:127.0.0.1:<remote_port> user@remote

Explanation:

Substitute the placeholders for the port of the listening service (e.g. 8085 for Google Oauth) and the hostname/IP of the machine that is listening on that port only in loopback. This will create an SSH tunnel from the port on your local machine to the normally loopbacked port listened on by the service.