suse linux vnc多用户远程桌面配置实战

在suse linux上如何实现VNC的多用户远程桌面配置呢,我们看下面的实际案例。

一、启动和配置VNC服务

suse linux中一般默认安装了VNC组件包,服务器空间,可以直接进行启动

#vncserver

You will require a password to access your desktops.

Password:(输入密码)

Verify: (再次输入)

提示:Would you like to enter a view-only password (y/n)? n(是否输入一个只能查看的密码,选择否)

提示信息如下:

xauth: creating new authority file /root/.Xauthority

New ‘X’ desktop is -eyh7:1(桌面编号为1)

Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/-eyh7:1.log

接下来配置xstartup启动脚本。

用VI编辑/root/.vnc/xstartup脚本

内容如下:

#!/bin/sh

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80×24+10+10 -ls -title "$VNCDESKTOP Desktop" &

twm &

将最后一行改为

gnome-session &

保存后,重启vnc.注:在/root/.vnc/目录下有成对的log和pid文件,名如 machineName:1.pid和 machineName:1.log,有文件的pid是活动的服务,服务号码就是pid前面的数字。没有pid文件的是已经停止的服务。

可以使用 vncserver :号码 启动停止的服务

可以使用 vncserver -kill :号码 停止服务

注意:你当前是在ROOT用户下编辑和配置的,那么你的VNC默认就是ROOT用户可以远程VNC连接

二、配置VNC的多用户远程桌面

如果需要配置SUSE LINUX的VNC多用户远程桌面,我们还需要一个关键文件,美国服务器,就是/etc/sysconfig目录下的

vncservers的文件。可是当你进入到这个目录时,会发现在SUSE LINUX中并没有这个一个文件,难道SUSE linux里不能实现么?

我们可以这样做,把REDHAT LINUX里的这个文件复制过来,因为VNC的原理是一样的。

linux-wq:/etc/sysconfig # vi 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:>.

# 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 800×600 -nolisten tcp -nohttpd -localhost"

(仿照上面两句的示例,在文件末尾添加如下语句)

VNCSERVERS="1:root"

VNCSERVERARGS[1]="-geometry 800×600"

VNCSERVERS="2:test"

VNCSERVERARGS[2]="-geometry 800×600"

或者也可这样设置

VNCSERVERS="1:root 2:test" #此处对所有要登录的用户进行说明.

VNCSERVERARGS[1]="-geometry 800×600 " #此处即是各用户的配置

VNCSERVERARGS[2]="-geometry 800×600 "

完成后保存

然后还要注意,远程桌面2是跟TEST用户绑定的。我们需要进行如下设置

linux-wq:/home # su – test

test@ linux-wq:~> vncserver :2

You will require a password to access your desktops.

Password:

Verify:

Would you like to enter a view-only password (y/n)? n

xauth: creating new authority file /home/test/.Xauthority

New ‘X’ desktop is linux-wcqm:2

Creating default startup script /home/test/.vnc/xstartup

Starting applications specified in /home/test/.vnc/xstartup

Log file is /home/test/.vnc/linux-wcqm:2.log

然后再修改TEST用户的VNC配置文件

test@linux-wcqm:~> cd /home/test/.vnc

test@linux-wcqm:~/.vnc> ls

linux-wcqm:2.log linux-wcqm:2.pid passwd xstartup

test@linux-wcqm:~/.vnc> vi xstartup

#!/bin/sh

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80×24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#twm &

同理需要将最后一行改为

gnome-session &

然后保存退出。

三、测试和验证

使用ultra vnc客户端软件来进行测试和验证

1、使用ROOT用户来登陆

2、使用TEST用户来登陆

好了,大家赶快试试吧。

微信二维码51CTO滴水穿石

本文出自 “滴水穿石” 博客,香港空间,谢绝转载!

与一个赏心悦目的人错肩,真真实实的活着,也就够了。

suse linux vnc多用户远程桌面配置实战

相关文章:

你感兴趣的文章:

标签云: