Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine what ports X is listening on?

My use case is that I am running nx over ssh and the local proxy connects to the remote host via tunneling. Because it's tunneled, I tell nx to connect to localhost:port. The problem is that I need to perform X authentication and if I hit the local X server by accident instead of the remote one, I get an authentication error.

How can I determine what port the local X server is listening on so that I can avoid it when setting up my tunnel?

My current workaround is to avoid tunneling with any local port which already has another application listening on it.

like image 581
Zhro Avatar asked Jul 23 '13 18:07

Zhro


1 Answers

It's usually screen number + 6000. For example, if $DISPLAY is :5 port number is 6005

like image 187
Andrey Sidorov Avatar answered Oct 20 '22 04:10

Andrey Sidorov