vnc问题

1、vnc连接rhel5.9后,注销系统后再次连接未能正常显示(桌面图标未能正常显示)

详情如下图:

 

解决方式:(重启vnc)

vncserver -kill :1     #关闭vnc端口
vncserver :1            #启动vnc端口1

 

 

介意方式:(点击vnc关闭按钮)

 

2、实现多用户登录

举例:

useradd cosmos           #添加用户shen

passwd cosmos            #设置用户的linux登录密码

su - cosmos                 #切换到用户shen

vncpasswd              #设置用户shen的vnc客户端登录密码

exit

vi /etc/sysconfig/vncservers       #添加vnc配置信息

在最后加上:

VNCSERVERS="1:root 2:cosmos"

VNCSERVERSVNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared" 

VNCSERVERSVNCSERVERARGS[2]="-geometry 1024x768 -alwaysshared"

vi /etc/sysconfig/iptables    #添加iptable信息:(端口号)

Vnc1:5901、5801

Vnc2:5902、5802

su – cosmos

find -name xstartup            #查找xstartup

vi ./.vnc/xstartup                 #解决vnc2灰屏问题

#!/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 &

gnome-session &

service vncserver stop         #关闭vnc

service vncserver start         #启用vnc

#停止某个vnc连接:

vncserver -kill :1        #关闭vnc端口1
vncserver :1               #启动vnc端口1

猜你喜欢

转载自www.cnblogs.com/cos235817497/p/9494930.html
VNC