I’ve been using Cloudflare Tunnels to SSH from my machine to a server, with the cloudflared
approach described here: SSH · Cloudflare Zero Trust docs
Everything is working fine. When I try to SSH into my server, the browser opens, I authenticate myself through Cloudflare Zero Trust ([email protected]
) and then the SSH connection is established.
Now, let’s say that I’m trying to connect to my SSH server using the user luis
, as in ssh -i key.pem [email protected]
. Let’s also say that, via /etc/passwd
I defined that the “shell” for luis
is a custom script called myscript.sh
.
I’ve been successfully doing that for a while now too, but the question is: In myscript.sh
, how could I get from Cloudflare which Zero Trust user is SSHing into the server? That is, how could myscript.sh
know that the user authenticated via Zero Trust is in fact [email protected]
?