After logging into a network via SSH, the network's default shell being used is BASH.
It is then possible to run applications which utilize graphics only if X11 forwarding has been enabled which I usually do via the -X
option while logging in:
ssh -X [email protected]
I notice that when it is enabled the DISPLAY environmental variable exists and is set as such DISPLAY=localhost:11.0
, however there is nothing stopping the user from exporting an environmental variable named the same thing, making it look as if it has been enabled.
Is there a way from the bash shell or a bash script to determine if X11 Forwarding is enabled?