(2) Edit configuration file:
[code]
Execstart=/sbin/runuser-l user-c "/usr/bin/vncserver%i-geometry 1280x1024
Pidfile=/home/user/.vnc/%h%i.pid
Replaces user with the VNC service to use, such as root:
Code as follows:
EXECSTART=/SBIN/R Unuser-l root-c "/usr/bin/vncserver%i"
If you want to modify the resolution, you can modify the geometry content, and others do not need to be modified.
And then keep the configuration.
(3) uses the SYSTEMCTL command to force a re-read of the configuration file: The
Code is as follows:
~]# systemctl daemon-reload
(4) Configure Vncserver password
The p> code is as follows: vncpasswd
(5) If two users want to use VNC at the same time, you need to configure two profiles:
Vncserver-user_1@.service and Vncserver-user_ 2@.service, the file content is configured with the root user
And then the VNC password is created for two users: the
Code is as follows:
~]$ su-user_1
~]$ vncpasswd
Password: Verify:
~]$ su-user_2
~]$ vncpasswd
Password:
Verify:
(6) Start VNC service
Code as follows:
Systemctl start vncserver@:10
To boot, use the following command:
Code as follows:
SYSTEMCT L Enable vncserver@:10
Ln-s '/etc/syStemd/system/vncserver@.service '
'/etc/systemd/system/multi-user.target.wants/vncserver@:10.service '
(7) Close process
Code as follows:
Systemctl disable vncserver@:d isplay_number.service
Systemctl stop Vncserve r@:d Isplay_number.service