For a given ssh session, is there a way to tell if it has x-forwarding enabled? I.e. you don't know if the session was established with ssh username@address
or with ssh -X username@address
.
Asked
Active
Viewed 442 times
3

DilithiumMatrix
- 133
- 4
1 Answers
4
One simple indication is to look to see if a valid looking DISPLAY variable is set. If no display is set, you can be almost certain forwarding is not working properly.
$ export | grep DISPLAY
declare -x DISPLAY="localhost:10.0"

Zoredache
- 130,897
- 41
- 276
- 420