欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

VNC配置

程序员文章站 2022-06-05 20:37:01
...

1.root用户

  • 端口:5901
yum install -y tigervnc-server tigervnc vnc vnc-server
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
sed -i '40s/<USER>/root/g' /etc/systemd/system/vncserver@:1.service
###将/<USER>改为/root
sed -i '41s#/home/<USER>#/root#g' /etc/systemd/system/vncserver@:1.service
###将/home/<USER>改为/root
vncpasswd                   
systemctl daemon-reload
systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service

2.其他用户

  • 端口:5902
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:2.service
sed -i '40s/<USER>/spark/g' /etc/systemd/system/vncserver@:2.service  
###将/<USER>改为/spark      
sed -i '41s#/home/<USER>#/home/spark#g' /etc/systemd/system/vncserver@:2.service
###将/home/<USER>改为/home/spark
su - spark
vncpasswd
vncserver :2
vncserver -kill :2
exit
systemctl daemon-reload
systemctl start vncserver@:2.service
systemctl enable vncserver@:2.service
相关标签: VNC