分类: LINUX
2011-03-27 18:23:28
To change the default port for vncserver on Linux from 5900 (+display number), you must first open the file /usr/bin/vncserver as root (or sudo) with your favorite text editor. If you scroll down to around 25% mark in the file, you’ll see the line:
$vncPort = 5900 + $displayNumber;
Change 5900 to whatever port you would like, save the file, stop and restart the vnc service.
Java (port 5800 + display number) doesn’t seem to change, so how do we change it? This is a little easier. When starting up your vnc server, just add the option “-httpport “. /etc/sysconfig/vncservers For example:
vncserver -display 800x600 -depth 16 -httpport 5000