互通有无,共同提高。
全部博文(144)
分类: 系统运维
2011-01-06 11:16:06
# gdmsetup
Remote Login disable---改为Same as Local
Security 取消Deny TCP connection to Xserver前面的勾
# gdm-restart
RHEL6.X的系统,需编辑/etc/gdm/custom.conf,增加以下内容:
[security]
#允许用root用户进行远程连接
AllowRemoteRoot=true
[xdmcp]
#启动远程连接服务支持
Enable=true
#服务端口
Port=177
(值得一提的是:由于安装系统时没有选上相应的组件,在A机上没有rlogin服务,即在/etc/xinetd.d下没有rlogin文件。于是,把linux系统安装盘放入光驱,点开System Settings--Add/Remove Applications--Add or Remove Packages,找到相应组件,安装即可。
========================================================
Linux/Unix Command: xhost
"Networking" on Linux
In contrast to the typical use of traditional "personal" computers, in Linux/Unix environments, working "on the network" has always been the norm, which explains the powerful networking features of Unix and Linux operating systems. You can easily connect to other computers and run graphical user interfaces over the network. In this article we describe a simple method to do your work on any computer on the network without leaving your seat.
The key command is: xhost - the server access control program for X. The xhost program is used to add and delete host (computer) names or user names to the list of machines and users that are allowed to make connections to the X server. This provides a rudimentary form of privacy control and security.
Overview: Let's call the computer you are sitting at the "local host" and the computer you want to connect to the "remote host". You first use xhost to specify which computer(s) you want to give permission to connect to (the X-server of) the local host. Then you connect to the remote host using telnet. Next you set the DISPLAY variable on the remote host. You want to set this DISPLAY variable to the local host. Now when you start up a program on the remote host, its GUI will show up on the local host (not on the remote host).
Example of a Typical Use
Assume the IP address of the local host is 128.100.2.16 and the IP address of the remote host is 17.200.10.5. Depending on the network you are on, you may also be able to use the computer names (domain names) instead of the IP addresses.
Step 1. On the local host
Type the following at the command line:
% xhost + 17.200.10.5
< press return >
Step 2. Log on to the remote host
% telnet 17.200.10.5
Step 3. On the remote host (through the telnet connection)
Instruct the remote host to display windows on the local host by typing:
% setenv DISPLAY 128.100.2.16:0.0
at the command line. (Instead of setenv you may have to use export on certain shells.)
< press return >
Step 4. Now you can run software from the remote host.
E.g.: when you type % xterm on the remote host, you should see an xterm window on the local host.
Step 5. After You Finish
You should remove the remote host from your access control list as follows. On the local host type:
% xhost - 17.200.10.5
< press return >
Quick Reference - xhost
◆ xhost + hostname: Adds hostname to X server access control list.
◆ xhost - hostname: Removes hostname from X server access control list.
◆ xhost + : Turns off acccess control (all remote hosts will have access to X server)
◆ xhost - : Turns access control back on.
Important: Use the man command (% man) to see how a command is used on your particular computer.
===========================
◆ If you always plan to display everything back to one host, you can set the DISPLAY variable in your .cshrc file on all the remote hosts you plan on logging.
setenv DISPLAY localhost:0.0
◆ You can set up aliases in your .cshrc file for all the potential machines you plan on displaying X applications back from. Then no matter which hosts you might be logged in to, you will always be able to set the display.
alias setrocket 'setenv DISPLAY rocket:0.0'
alias setmoon 'setenv DISPLAY moon:0.0'
alias setpluto 'setenv DISPLAY pluto:0.0'
◆ Execute a remote shell that displays back an xterm window. When any applications within that window are executed, it automatically displays back on the local host.
% rsh remotehost -n /usr/bin/X11/xterm -display $DISPLAY
按照上述说明,在远程机的.cshrc文件中设置本地机的DISPLAY别名,也可以得到简化操作的效果。通常用ssh服务,不用rsh。现在要试的是,怎样使用下面的命令才能让远程显示返回到本地(试了几次,显示总是返回不到本地。待问题解决后再给出说明)。
% ssh remotehost -n /usr/bin/X11/xterm -display $DISPLAY
(另见, [求助] 工作站之间登录时,如何自动设置terminal type 为 vt100 )--问题已解决。
注释:
即,编辑$OWHOME目录下的.lgctermlogin文件,找到并注释掉set INKEY=($<)的行,然后在其下面添加一行set INKEY=v保存退出。如:
# set INKEY=($<)
# set INKEY=($<)
set INKEY=v
这时,运行 source .lgctermlogin,即可看见效果了,如:
wx02{owr5000}% source .lgctermlogin
Terminal type (v) VT100, ie. Wyse 85
(b) vt100 (BS erase)
Enter terminal type:
** TERM set to vt100 **
wx02{owr5000}%
i4knowledge2011-01-18 13:25:33
山定子老师你好,看了你的这个从工作站远程登录另一个工作站,感觉很受启发,但是还有点不大明白,你touch 的那个 188 ,还有200 ,应该放在哪个路径下?能不能再把这个程序代码写详细些~谢谢~