温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何进行suse linux vnc多用户远程桌面配置实战

发布时间:2021-10-21 18:08:44 来源:亿速云 阅读:391 作者:柒染 栏目:云计算

如何进行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 80x24+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: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"

VNCSERVERARGS[1]="-geometry 800x600"

VNCSERVERS="2:test"

VNCSERVERARGS[2]="-geometry 800x600"

或者也可这样设置

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

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

VNCSERVERARGS[2]="-geometry 800x600 "

完成后保存

然后还要注意,远程桌面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 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#twm &

同理需要将最后一行改为

gnome-session &

然后保存退出。

三、测试和验证

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

1、使用ROOT用户来登陆

如何进行suse linux vnc多用户远程桌面配置实战

如何进行suse linux vnc多用户远程桌面配置实战

2、使用TEST用户来登陆

如何进行suse linux vnc多用户远程桌面配置实战

如何进行suse linux vnc多用户远程桌面配置实战

修改VNC访问的密码
  使用命令vncpasswd对不同用户的VNC的密码进行修改,一定要注意,如果配置了不同用户的VNC需要分别到各自用户中进行修改,例如在我的这个实验中,root用户和oracle用户需要分别修改,修改过程如下:
  [root@testdb ~]# vncpasswd
  Password:
  Verify: 

好了,大家赶快试试吧。

看完上述内容,你们掌握如何进行suse linux vnc多用户远程桌面配置实战的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI