Linux 5.7 x86-64bit VNC 配置 解决登陆VNC灰色界面 配置多个用户登录

来源:互联网 发布:苹果吉他软件效果器 编辑:程序博客网 时间:2024/06/05 15:46
配置环境:
Linux 5.7 x86-64bit

问题描述:

1:解决VNC登录

2:配置 解决登陆VNC灰色界面 信息如下:

Accept clipboard from viewers
Send clipboard to viewers
Send primary selection to viewers

3:配置 多用户登录方法


安装方法:

============================================================================================================
1、查询vnc软件
============================================================================================================

[root@orcl-db-01 ~]# rpm -qa|grep vnc
vnc-4.1.2-14.el5_6.6

vnc-server-4.1.2-14.el5_6.6


============================================================================================================
2、VNC配置多个用户vncservers 配置文件
============================================================================================================

#vi /etc/sysconfig/vncservers

[root@orcl-db-01 ~]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.  
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

VNCSERVERS="1:root 2:oracle"

VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"


============================================================================================================
3、启动 vncserver,设置多个VNC用户密码
============================================================================================================

注意:用root 帐号登录,设置root vnc帐号密码
[root@orcl-db-01 ~]# vncserver
You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /root/.Xauthority


New 'orcl-db-01:1 (root)' desktop is orcl-db-01:1


Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/orcl-db-01:1.log

注意:用oracle 帐号登录,设置oracle vnc帐号密码
[oracle@orcl-db-01 root]$ vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /home/oracle/.Xauthority

New 'orcl-db-01:2 (oracle)' desktop is orcl-db-01:2

Creating default startup script /home/oracle/.vnc/xstartup
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/orcl-db-01:2.log


============================================================================================================
4、VNC的启动/停止/重启
============================================================================================================


#service vncserver start/stop/restart
#/etc/init.d/vncserver start
service vncserver restart


============================================================================================================
5、配置多个用户 xstartup启文件配置:
============================================================================================================


注意:配置这项,可以解决登陆VNC灰色界面的解决方法

vi /root/.vnc/xstartup

修改 xstartup 内容如下:
a:
修改xstartup文件,去掉
unset SESSION_MANAGER 和
exec /etc/X11/xinit/xinitrc  前面的注释符号
b:
将最后一行twm &  改成 gnome-session &

修改 root 用户 xstartup 文件:

[root@orcl-db-01 ~]# vi /root/.vnc/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 &
gnome-session &

修改 oracle 用户 xstartup 文件:

[oracle@orcl-db-01 root]$ vi /home/oracle/.vnc/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 &
gnome-session &

更改完后保存,重新启动VNC即可


============================================================================================================
6、VNC的启动/停止/重启
============================================================================================================

#service vncserver start/stop/restart
#/etc/init.d/vncserver start
service vncserver restart

关闭具体的vncserver命令:
[root@orcl-db-01 ~]# vncserver -kill:1
Unable to start Xvnc, exiting
[root@orcl-db-01 ~]# vncserver -kill:2
Unable to start Xvnc, exiting
[root@orcl-db-01 ~]# 


============================================================================================================
7、远程登录
============================================================================================================

a、root帐号
11.12.19.71:5901

11.12.19.71:1

b、oracle 
11.12.19.71:5902

11.12.19.71:2

0 0
原创粉丝点击