如何远程连接到Linux服务器的:0会话? [英] How can I remote connect to the :0 session of my linux server?

查看:106
本文介绍了如何远程连接到Linux服务器的:0会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我正在尝试使用VNC远程连接到我的linux服务器.

从今天开始,我已经可以使用准备好的会话:10"来连接它了,它就像魅力一样工作.

问题是我决定虚拟化服务器并使用VMWARE Player启动它.那么对我来说,重要的是能够监视vmware player软件,能够搜索更新,然后...如果需要,请重新启动...

如果我从会话:10远程执行VMWare播放器,那么我将无法从物理计算机上看到vmware播放器,因此我想避免使用它.

我曾考虑过远程连接到我的:0会话,但是它仅在用户登录物理机时才起作用,因此对我来说没有任何意义.

在用户登录的同时,由于它可以正常工作,所以我想网络权限,端口和其他配置都很好...

有什么主意吗?

一如既往,谢谢您!

解决方案

我不明白这个问题.

但是随之而来的是一些可能性...

您拥有名为A的计算机(物理).

A上运行着一个VM,该VM创建了虚拟服务器B.

在VM软件本身中排除某些特定的API B并不知道它正在VM中运行.

如果您想了解有关A的某些知识,那么您必须在A上运行一些知识.您不能在B上了解A的任何知识(不包括某些特定的API)上运行.


经过大量搜索后,我在LinuxQuestions.org上找到了这篇文章:

http://www .linuxquestions.org/questions/red-hat-31/how-to-enable-vnc-console-on-rhel-5-server-635622/ [这是为了设置VNC以提供对本地默认X控制台的访问,就像您坐在物理控制台上一样. (这些说明不适用于为单个用户提供5级显示): 为RHEL 5服务器配置VNC 普拉特– 04/14/2008 要将VNC设置为控制本机X服务器,请按照下列步骤操作: ****步骤1.在要使用VNC控制的系统上,以root用户身份运行程序vncpasswd来设置VNC密码.与vncviewer或其他VNC远程控制程序连接时,将使用此密码. ****第2步.在RHEL 5上编辑文件/etc/X11/xorg.conf [A]在文件末尾创建名为Module的部分,并添加以下行: 模块"部分 加载"glx" 加载"dbe" 加载"extmod" 加载"freetype" 加载"type1" 加载"dri" 加载"vnc" 结束部分 确保在EndSection之前将其放在新行上. [B]在屏幕"部分中,添加以下行: 选项"passwordFile""/root/.vnc/passwd" 确保在EndSection之前将其放在新行上. **** STEP3 –允许防火墙中的端口 1. SSH到服务器,然后运行以下工具: 2.#system-config-securitylevel 3.在其他端口"中,请添加一个范围,如下例所示.请注意,这些将是TCP端口,如下所示: 5900-5904:TCP 4.保存并关闭该工具,然后重新启动防火墙: #服务iptables重新启动 ****步骤4:确保使用chkconfig为2、3、4、5级启用了vncserver.然后重新启动机器. 注意:如果您怀疑防火墙被阻塞,请完全禁用防火墙,并测试VNC是否有效.我使用tightVNC进行测试. VNC通常将使用端口59xx,其中"xx"是控制台号.使用命令netstat -na |较少查看系统上打开的端口.在VNC的5xxx范围内查找.



:thumbsup:


Hello all!

I''m trying to use VNC to remotely connect to my linux server.

Since today I''ve been able to use a prepared session ":10" in order to connect to it and it worked like charm.

The problem with that is that I''ve decided to virtualize a server and to use VMWARE player to launch it. Then it is important for me to be able to monitor the vmware player software, to be able to search for updates and so... relaunch it if needed...

If I executer the VMWare player remotely from the session :10 then I would not be able to see the vmware player from the physical computer and I would like to avoid it.

I''ve thought on connecting remotely to my : 0 session, but it only works meanwhile the user is logged in the physical machine so it has no sense for me.

As it works meanwhile the user is logged in, then I guess that the network permissions, ports and others are well configured...

Any idea?

As always thank you in advance!

I don''t understand the question.

But some possibilities follow...

You have computer (physical) called A.

A has a VM running on it which creates virtual server B.

Excluding some specific API in the VM software itself B doesn''t know that it is running in VM.

If you want to know something about A then you must run something on A. You can''t run anything on B that knows about A (excluding some specific API.)

And the same applies to B.


After searching a lot, I''ve found this post in LinuxQuestions.org:

http://www.linuxquestions.org/questions/red-hat-31/how-to-enable-vnc-console-on-rhel-5-server-635622/[^]

Thank you Pratul!

Here''s an excerp that shows exactly how to do what I need:

This is to setup VNC to provide access to the local default X console as if you are sitting on the physical console. (These instructions are not for providing level 5 display for individual users):

CONFIGURING VNC FOR RHEL 5 SERVERS
Pratul – 04/14/2008

To set up VNC to control the native X server, follow these steps: 

****STEP1. On the system you want to control with VNC, run the program vncpasswd as root to set a VNC password. You will use this password when connecting with vncviewer or another VNC remote control program. 

****STEP2. Edit the file /etc/X11/xorg.conf on RHEL 5 

[A] Create the section called Module in the end of the file and add following lines: 
Section "Module"
Load "glx"
Load "dbe"
Load "extmod"
Load "freetype"
Load "type1"
Load "dri"
Load "vnc"
EndSection
Make sure this is on a new line before EndSection.

[B] In section called Screen, add this line: 
Option "passwordFile" "/root/.vnc/passwd"

Make sure this is on a new line before EndSection. 


****STEP3 – Allow the ports in Firewall

1. SSH to the server and Run the following tool: 
2. # system-config-securitylevel
3. In the "Other ports", please add a range as in below example. Note that those will be TCP ports as below: 

5900-5904:tcp

4. Save and close the tool then restart firewall: 
# service iptables restart

****STEP4: Make sure using chkconfig that vncserver is enabled for level 2,3,4,5. Then RESTART the machine. 

Note: If you suspect the firewall blocking, then disable the firewall altogether and test VNC if it works. I use tightVNC to test.

VNC will typically use port 59xx, where "xx" is the console number. Use the command netstat -na | less to see the ports that are open on the system. Look in the 5xxx range for VNC.



:thumbsup:


这篇关于如何远程连接到Linux服务器的:0会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆