How to change openwin's tcp port number

How to change openwin's tcp port number

Post by Casper H.S. Dik - Network Security Engine » Mon, 22 Dec 1997 04:00:00



[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>Hi,experts of solaris
>Could anybody tell me how to change Solaris 2.5.1's openwindows's tcp port
>number? I have a set of application used tcp port 6000, and I found it was
>occupied by openwin's X server. If you can solve this problem, please let
>me know. Thanks a lot

You can't.

And picking port 6000 for your application isn't a good idea.

All X servers use port 6000, putting somethign else tehre will give
unexpected results.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

How to change openwin's tcp port number

Post by Bill Pa » Mon, 22 Dec 1997 04:00:00


Daring to challenge the will of the almighty Leviam00se, Casper H.S. Dik -

: [[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

: >Hi,experts of solaris
: >Could anybody tell me how to change Solaris 2.5.1's openwindows's tcp port
: >number? I have a set of application used tcp port 6000, and I found it was
: >occupied by openwin's X server. If you can solve this problem, please let
: >me know. Thanks a lot

: You can't.

Well... that's not strictly true. That is, you can't just edit a config
file somewhere and magically have the X server use a different port, but
you can make it use a different number.

The port number depends somewhat on the display number. That is, when
you start the X server on a single-head display, that server instance
becomes display :0 and clients can contact it at port 6000. But if the
display is instead set as :1, then it will use port 6001. If it's :2
then it will use 6002, and so on. (If the X server supports combining
multiple frame buffers into a single display, then you may have the
same display number with multiple screes, i.e. :0.0, :0.1, :0.2, etc.)
If you are using openwin without CDE (meaning that you log in on the
console and start openwin manually) then you can create a .xserverrc
file in your home directory and place in it the flags to pass to the
X server when it starts, including the display number. If you use :1
instead of :0, then the server will use port 6001. If you are using
CDE, then you'll either have to use 'Command line login' to get into
the system and start openwin manually or edit /usr/dt/config/Xservers
so that it uses :1 instead of :0 and restart dtlogin.

The downside to doing this is that if you have an X11 application
somewhere that is set to always use display :0, you may have to tweak
it to use the new display value.

: And picking port 6000 for your application isn't a good idea.

: All X servers use port 6000, putting somethign else tehre will give
: unexpected results.

Agreed: selecting port 6000 is a bad idea. If you wrote the program,
then I suggest changing it to use a different port. Better still,
change it to use getservbyname() so that you can register the port
number in your /etc/services file (or services NIS/NIS+ database).
That way you can change the port just by updating the services database
and the application will pick up the change automatically.

-Bill

--
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu


=============================================================================
  "Now, that's "Open" as used in the sentence "Open your wallet", right?"
=============================================================================

 
 
 

1. ipchains/TCP/UDP, Why should I open UDP ports so that my TCP ports can work?

Hi,

I have set up firewall to accept some ports.
/sbin/ipchains -F input
/sbin/ipchains -P input ACCEPT
/sbin/ipchains -A input -p TCP -s 0/0 --dport ssh -j ACCEPT
/sbin/ipchains -A input -p UDP -s 0/0 --dport ssh -j ACCEPT
....

Then I want to lock down all other ports.
/sbin/ipchains -A input -p TCP -s ! 192.168.0.0/24 -j DENY

#??? what's wrong with this UDP ???
/sbin/ipchains -A input -p UDP -s ! 192.168.0.0/24 -j DENY

If I comment out the UDP line, I can ssh into firewall from outside.
If I don't comment out that line, I can no longer ssh into firewall from
outside.

Why should I open UDP ports so that my TCP ports can work?

Thanks for any help.

Ed Wu

2. glibc source

3. can't get openwin to run openwin-init

4. Sound disappears ca 1 hour after boot

5. How to change the number of 'rlogin' limit to a DECstation ?

6. Cannot access Red Hat 7.2 from the Internet

7. not able to change the 'Cable Type' in TCP/IP Config

8. FoxPro (SCO) terminal control.

9. TCP port number and process

10. Flexfax -- "Can not find port number for 'fax' service" -- ???

11. How to get tcp port numbers on Solaris 8/9

12. Socket Question, How to 'quickly' free port number.

13. lpd TCP port number