您的位置:首页 > 运维架构 > Linux

linux 远程连接配置 Xmanager

2013-09-16 16:53 260 查看
Xmanager连接rhel5服务器

rhel5与rhel4不同的地方是,rhel5里没有/etc/X11/gdm/这个目录,rhel5的gdm的配置文件放在/usr/share/gdm/defaults.conf。

修改/usr/share/gdm/defaults.conf和/etc/gdm/custom.conf文件,确保里面以下几行生效:
Enable=true

DisplaysPerHost=10

Port=177

再修改/etc/inittab文件,把默认级别改为5,再加入以下行:

x:5:respawn:/usr/sbin/gdm

如果需要使用root用户登录,还要继续修改/usr/share/gdm/defaults.conf文件如下部分:
[security]
AllowRoot=true
AllowRemoteRoot=true

防火墙修改:

修改/etc/sysconfig/iptables 文件,添加以下内容: 

-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 177 -j ACCEPT

最后重启系统:reboot


 CentOS 6.3配置

 [root@localhost ~]# rpm -q vnc vnc-server
                     vnc-4.1.2-14.el5_3.1
                     vnc-server-4.1.2-14.el5_3.1
   如果没有安装,则安装他们
   [root@localhost ~]# yum install vnc vnc-server     #ubuntu的话,就是执行apt-get install vnc vnc-server


[root@localhost ~]# vncserver         #运行vncserver。
                   You will require a password to access your desktops.
                   enter password:                       #首次运行会让你设置密码,密码要求6位以上


[root@localhost
~]#vncserver -kill :no(窗口编号) #关闭窗口编号为no的vncserver


[root@localhost
~]#vncserver :no #以窗口编号为no运行vncserver


[root@localhost
~]#vi /etc/sysconfig/vncservers   #编辑相关窗口配置文件,窗口分辨率等(可做可不做)


[root@localhost
~]# vi ~/.vnc/xstartup       #编辑这个配置脚本文件,配置使远程登录为gnome或者kde桌面。(基本都不用做,一般设置好了)


[root@localhost
~]#vi /etc/sysconfig/iptables #配置防火墙 加入对应的端口,一般端口为590*或580*


-A
INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5903 -j ACCEPT


[root@localhost
~]#service
iptables restart #重启防火墙服务
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: