[root@localhost /]# vncpasswd
Password:
Verify:
[root@localhost /]# su - etl
[etl@localhost ~]$ vncpasswd
Password:
Verify:
[etl@localhost ~]$
4、启动vncserver服务
[root@localhost ~]# service vncserver start
Starting VNC server: 1:root
New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
2:etl
New 'localhost.localdomain:2 (etl)' desktop is localhost.localdomain:2
Creating default startup script /home/etl/.vnc/xstartup
Starting applications specified in /home/etl/.vnc/xstartup
Log file is /home/etl/.vnc/localhost.localdomain:2.log
[ OK ]
VNC会在用户根目录($HOME)下的".vnc"文件夹下生成一系列文件。其中passwd为vnc用户密码文件,由vncpasswd生成。其他的都由vnc初次启动时生成,xstartup为VNC客户端连接时启动的脚本
5、配置xstartup文件
如下所示,将下面紫红色的部分注释取消。

#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
切换到etl账号,炮制
[root@localhost ~]# su - etl
[etl@localhost ~]$ vi /home/etl/.vnc/xstartup

[root@localhost ~]# service vncserver restart
Shutting down VNC server: 1:root 2:etl [ OK ]
Starting VNC server: 1:root
New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/shumachanpin/article-43005-3.html
哈哈加油
干嘛不把我大汉帝国虽远必诛的经验也集成进来
淘宝卖20你还买
#易烊千玺##易烊千玺献声小王子#千千