admin 管理员组

文章数量: 1086019


2024年12月26日发(作者:软件开发项目有哪些)

----VNC 配置

1.检查rpm包是否安装

[oracle@niuge ~]$ rpm -qa|grep vnc

4

4

只要有第一个这个就足够,这是服务端运行程序。如未安装,请安装

2.安装好后运行 vncserver

[test@niuge ~]$ vncserver

You will require a password to access your desktops.

Password:

Verify:

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

New ' niuge:3 (test)' desktop is niuge:3

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

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

Log file is /home/test/.vnc/niuge:

会提示你输入登录密码,同时会给你提示,记住这个":3" 这是你vnc客户端登录时候要用到的,我机器已经开启了2个,所以这个是:3

3.在windows机器上装好vnc客户端,装好后运行客户端,输入方式如下图所示

点击OK后提示输入你刚才设置的密码。点击后就会进入

ok!是不是觉得命令行方式不爽,别着急,修改一下配置就可以进入windows模式

4.刚才在开启vncserver时候有如下提示:

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

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

Log file is /home/test/.vnc/niuge:

我们来看看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 &

ok!看说明很容易就知道如何正常进入desktop了

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER

exec /etc/X11/xinit/xinitrc

修改后保存退出

先停止vncserver:

[test@niuge ~]$ vncserver -kill :3

Killing Xvnc process ID 30475

[test@niuge ~]$

重启vncserver

[test@niuge ~]$ vncserver

New 'niuge:3 (test)' desktop is niuge:3

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

Log file is /home/test/.vnc/niuge:

OK!让我们重复上边的步骤重新登录vnc

熟悉的画面出现了。

今天在oracle linux下配置了一下X manager 和vnc,是第一次配置vnc,vnc配置要比X manager简单许多这里记录一下:

---- X manager 配置:

1.修改GDM的配置文件,/etc/X11/gdm/,将[xdmcp]中的enable选项设置为true

[xdmcp]

# Distributions: Ship with this off. It is never a safe thing to leave

# out on the net. Setting up /etc/ and /etc/ to only

# allow local access is another alternative but not the safest.

# Firewalling port 177 is the safest if you wish to have xdmcp on.

# Read the manual for more notes on the security of XDMCP.

Enable=true

用vi编辑 进入后键入/xdmcp查找字符串xdmcp "n"是搜索下一句,这样就能快速的定位到xdmcp项

2.修改/etc/X11/xdm/xdm-config文件,将tPort: 0注释掉

! SECURITY: do not listen for XDMCP or Chooser requests

! Comment out this line if you want to manage X terminals with xdm

!tPort: 0

3.修改/etc/X11/xdm/Xaccess文件 #* #any host can get a login window 去掉此行首位的#

# right hand sides can match.

#

* #any host can get a login window

#

# To hardwire a specific terminal to a specific host, you can

4. 如果有防火墙,请打开177的端口

ok!配置完后用X manager进入吧

一:linux上配置远程桌面连接

1 修改/etc/X11/xdm/Xaccess文件,找到下面的语句:# * #any host can get a

login window

去掉最前面的#号,成为

该文件是X窗口的配置文件,目的是允许所有用户登陆。

2 我们修改/etc/X11/gdm/文件,找到下面的语句:

找到# XDMCP is the protocol that allows remote login. If you want to log into

# gdm remotely (I'd never turn this on on open network, use ssh for such

# remote usage that). You can then run X with -query to log in,

# or -indirect to run a chooser. Look for the 'Terminal' server

# type at the bottom of this config file.[xdmcp]

# Distributions: Ship with this off. It is never a safe thing to leave

# out on the net. Setting up /etc/ and /etc/ to only

# allow local access is another alternative but not the safest.

# Firewalling port 177 is the safest if you wish to have xdmcp on.# Read the

manual for more notes on the security of XDMCP.

Enable=false 这一段,将其中的false修改为true或1 xdmcp的功能上面的

这段话中已经讲的很清楚了,基本上就是Linux的图形界面的一个监听端口,端

口号为177 所以同时在该文件中,需要确保177端口打开,即如下代码:

# The port. 177 is the standard port so better keep it that way

#Port=177

去掉前面的#使该句生效 注:AS5中对应文件是/etc/gdm/,这

个必须要修改。

3 修改/etc/inittab文件

id:5:initdefault 如果id本来就为5就不用修改了

同时,找到如下图文字所在的地方

# Run xdm in runlevel 5

x:5:respawn:/etc/X11/prefdm -nodaemon

改为:

4 修改/etc/X11/xdm/xdm-config的最后一行,在

tPort:0前面加上一个!号,结果如下

5 修改确保/etc/X11/xdm/Xservers的属性为444,/etc/X11/xdm/Xsetup_0的属性为755,,我的这两个文件默认的属性就是444和

775,因此不用修改。

6 如果Linux机器配置有防火墙,为防止防火墙将通过177端口(即xdmcp服务)的数据过虑,必须加上如下的规则:

iptables -A INPUT -p udp -s 0/0 -d 0/0 --dport 177 -j ACCEPT

完毕后重启

二 Xmanager使用

1、打开Xmanager文件夹中的Xbrowser,选择New新建

2、选择XDMCP类型,然后Next

3、Method不管,Host填目标服务器IP,Port是177,Next

4、一路Next,最后勾选 Execute the session when this new session wizard,然后Finish

注意:如果还连接不上,可能是防火墙里eth0没有开启。

请在终端中输入setup,进入防火墙设置,查看

可信任的设备 eht0 前面打钩 就可以连接了。


本文标签: 防火墙 输入 进入 客户端 端口