One VNC session per user

$ vi /usr/bin/vncserver

301 # Now start the X VNC Server

302 

303 # Maximum session limit to 1 per user.

304 &vnclimit();

305 

890 }

891 }

892 

893 sub vnclimit {

894 $countoutput = `ps -u $ENV{USER} | grep -i Xvnc | wc -l`;

895 if ($countoutput >= 1) {

896 print "You are already running a VNC session for $ENV{USER} user. Maximum session is limited to 1 per user!\n";

897 print "Run 'vncserver -list' to list the current session\n\n";

898 print "Please contact your System Administrator for more details.\n";

899 exit;

900 }

901 }

refer to: How to restrict per user vnc sessions count ? - Red Hat Customer Portal

猜你喜欢

转载自blog.csdn.net/thesre/article/details/122993825
VNC