Chinaunix

标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题 [打印本页]

作者: ingood    时间: 2005-01-14 12:42
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
我是超级菜鸟,刚开始学linux,单位要装一个ftp,没想到碰到了很多问题。望各位大虾多多指点。

如果有大虾能够知道的,不放顺便说说解决思路,我自己觉得处理问题的效率太低,可能是看问题的方法不对,很想改进!!

我安装的是:REDHAT.ENTERPRISE.LINUX.AS.V3.0.UPDATE.3-RORiSO
从一个ftp下载的,安装后有以下问题。

1、配置xmanager不成功,可以发现机子,但不能出现图形界面
2、配置ftp后,服务启动正常,但用netstat -l 查看,没有ftp的监听,远程无法连接。
3、root登陆无法锁定屏幕

一、xmanager的问题
看过《linux版精华贴分类索引(2005/01/10更新) 》中的文章,
并查看了xmanager的FAQ,
XDMCP connection fails for Linux. How do I configure my Linux box?
How to configure Linux XDMCP(KDE/GNOME) settings for Xmanager

Affected Files

For runlevel: /etc/inittab
For GDM: /etc/X11/gdm/gdm.conf
For KDM: /etc/X11/xdm/xdm-config
/etc/X11/xdm/Xaccess
/etc/X11/xdm/kdmrc
/usr/share/kdm/kdmrc
/usr/share/config/kdm/kdmrc
/etc/opt/kde2/share/config/kdm/kdmrc
For Firewall: /etc/sysconfig/ipchains

Step 1. Change runlevel to enable gdm or kdm.

Open /etc/inittab file.
Change the runlevel to 5 as following:

id:5:initdefault:
Step 2. GDM configuration (When the Linux is using gdm)

Open /etc/X11/gdm/gdm.conf file.
Go to the [xdmcp]section.
Set the value of "Enable" option to "1".
Step 3. KDM configuration (When the Linux is using kdm)

Open /etc/X11/xdm/xdm-config file.
Comment out "requestPort" option as following:
DisplayManager.requestPort: 0
==>;
!DisplayManager.requestPort: 0
Open /etc/X11/xdm/Xaccess file.
Remove the initial "#" character for the following line:
#* #any host can get a login window
==>;
* #any host can get a login window
Open /etc/X11/xdm/kdmrc,
/usr/share/config/kdm/kdmrc or
/etc/opt/kde2/share/config/kdm/kdmrc file.
Change the value of "Enable" option to "true".
Step 4. Firewall configuration (If the firewall has been configured)

Open /etc/sysconfig/ipchains file.
Add the following lines at the top of the file:

-A input -p udp -s 0/0 -d 0/0 177 -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 telnet -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 ssh -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 login -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 exec -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 shell -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 7100 -j ACCEPT
Step 5. Restart your Linux to activate the changes.

以上都已经进行了设置,但还是不行。

二、VSFTPD的问题

看过《redhat linux 9.0 VSFTP配置大权(转载) 》等文章

/sbin/service vsftpd start 已经把服务起来,而且用
/sbin/chkconfig --level 345 tftp on并设为345引导期间启用

但远处ftp就是连接不上(防火墙规则已加)

我的vsftpd.conf文件如下
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
setproctitle_enble=YES
anon_root=/var/ftp/pub
listen_port=21

我真的无语咯。请各位指点。
作者: ingood    时间: 2005-01-14 12:51
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
另外很奇怪的是,/sbin/service vsftpd stop时会失败。restart也不行。不知道怎么回事。

xshell可以连上系统,输入redhat-config-securitylevel等命令可以跳出图形窗口。我的桌面是GNOME的。但用xmanger能监听到177端口,就是不能显示图形。
作者: xuhehao    时间: 2005-01-14 13:22
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
你贴的垃圾太多了,遇到问题拣关键的地方说!


service iptables stop
然后
netstat -an|grep 177
netstat -an|grep 7100
netstat -an|grep 21

有什么提示贴上来再说
作者: 好好先生    时间: 2005-01-14 13:24
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
先把防火墙停掉再试试,内网就不要用什么防火墙了,除非你对它的规则很熟悉,否则只会增加新手对linux的恐惧……
作者: ingood    时间: 2005-01-14 13:39
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
谢谢,总算有高手进来咯。呵呵

[root@ftp pam.d]# service iptables stop
Flushing firewall rules:                                   [  确定  ]
Setting chains to policy ACCEPT: filter                    [  确定  ]
Unloading iptables modules:                                [  确定  ]
[root@ftp pam.d]# netstat -an|grep 177
udp        0      0 0.0.0.0:177             0.0.0.0:*                           
[root@ftp pam.d]# netstat -an|grep 7100
unix  2      [ ACC ]     STREAM     LISTENING     2404   /tmp/.font-unix/fs7100
unix  3      [ ]         STREAM     CONNECTED     22815  /tmp/.font-unix/fs7100
[root@ftp pam.d]# netstat -an|grep 21
unix  2      [ ACC ]     STREAM     LISTENING     2521   /tmp/orbit-root/linc-853-0-1069a2b324457
unix  3      [ ]         STREAM     CONNECTED     23221  /tmp/.X11-unix/X0
unix  2      [ ]         DGRAM                    2143   
[root@ftp pam.d]#
作者: xuhehao    时间: 2005-01-14 13:42
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
[quote]原帖由 "ingood"] pam.d]#[/quote 发表:


7100和21没有listen

检查xfs和vsftpd配置是否正确
作者: ingood    时间: 2005-01-14 13:46
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
是不是这个问题啊
Step 6) Set up PAM for local logins (optional)

If you are running vsftpd on a PAM enabled machine, you will need to have a
/etc/pam.d/ftp file present, otherwise non-anonymous logins will fail. [NOTE -
if you have an older version of PAM, that file might be /etc/pam.conf]

For a standard setup, you can just copy a provided example file:
cp RedHat/vsftpd.pam /etc/pam.d/ftp

但系我的 RedHat文件夹里好像没有vsftpd.pam 这个文件。呵呵
作者: xuhehao    时间: 2005-01-14 13:51
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
原帖由 "ingood" 发表:

if you have an older version of PAM, that file might be /etc/pam.conf]

For a standard setup, you can just copy a provided example file:
cp RedHat/vsftpd.pam /etc/pam.d/ftp

但系我的 RedHat文..........


你的vsftpd没启动起来,具体的错误信息vi /etc/log/messages,解决问题要多尝试,多思考,多查阅,少说话
作者: ingood    时间: 2005-01-14 13:54
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
我防火墙开成全通的都没用,所以,我觉得不是防火墙的问题。

xfs我还真没配置,不知道要做什么配置
作者: ingood    时间: 2005-01-14 13:55
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
我防火墙开成全通的都没用,所以,我觉得不是防火墙的问题。

xfs我还真没配置,不知道要做什么配置。

vsftpd.conf我已经帖出来了,不知道有什么问题没有。是不是象我上面说的那个问题。vsftpd.pam在哪儿有
作者: xuhehao    时间: 2005-01-14 14:06
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
原帖由 "ingood" 发表:
我防火墙开成全通的都没用,所以,我觉得不是防火墙的问题。

xfs我还真没配置,不知道要做什么配置。

vsftpd.conf我已经帖出来了,不知道有什么问题没有。是不是象我上面说的那个问题。vsftpd.pam在哪儿有


vi /etc/rc.d/init.d/xfs
修改daemon xfs -droppriv -daemon添加 -port 7100选项

vi /etc/X11/XF86Config
修改FontPath    "unix:-1"为FontPath    "unix:7100"

vi /etc/X11/fs/config
修改no-listen = tcp为# no-listen = tcp
然后service xfs restart

vsftpd我不加修改就可以启动,最懒得看配置文件,让你看log你也不看,我也没办法~-~
作者: ingood    时间: 2005-01-14 14:06
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
对哦,我都忘了看/var/log/messages了。
不好意思。我自己再琢磨琢磨!
非常感谢xuhehao  和好好先生。
作者: 好好先生    时间: 2005-01-14 14:11
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
原帖由 "ingood" 发表:
对哦,我都忘了看/var/log/messages了。
不好意思。我自己再琢磨琢磨!
非常感谢xuhehao  和好好先生。


不客气。不过真佩服你的潜水功夫,快要两年了才几个贴子,是马甲吧?
作者: xuhehao    时间: 2005-01-14 14:15
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
原帖由 "好好先生" 发表:


不客气。不过真佩服你的潜水功夫,快要两年了才几个贴子,是马甲吧?


他发的帖子是被我勾引出来的~-~
作者: ingood    时间: 2005-01-14 15:33
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
不好意思,因为菜,所以不敢发帖,
而且工作很忙,涉及到unix和linux的系统也不是很多,所以,不是经常光顾。

这次遇到问题实在没有办法了,只好上来咨询咨询。

现在xmanger的问题已经解决了。
刚才配置了xfs还不行,后来在别的win2000的机器上试了一下,竟然没有问题。
看messages

gdm[2129]: gdm_auth_secure_display: Error getting hentry for ingood.tz.zpepc.com.cn
gdm[2129]: gdm_xdmcp_display_alloc: Error setting up cookies for ingood.tz.zpepc.com.cn:1
的错误。
查google,发现几篇英文的。e语差,但也只好硬着头皮上了,
看到这么一段
Check /var/log/messages and see if there are any from gdm.  This may be a
DNS lookup issue (i.e., your XP machine is not registered in DNS, or
registered, but not with the correct name).  Confirm by "nslookup YOUR_IP"
from the Linux machine.  If it is a DNS issue, try adding your XP machine
to /etc/hosts and restarting gdm ("kill -USR1 `cat /var/run/gdm.pid`".
        Igor
好像是域名反解析的问题。
在 /etc/hosts 里面增加我的ip地址和主机名
xmanger可以登陆成功。^_^

------------------vsftpd问题还没有解决

messages显示
xinetd: xinetd startup succeeded
vsftpd: vsftpd vsftpd succeeded

但是就是没有这个
ps -ef|grep vsftpd
也没有进程。
netstat -l也没有开放21端口
是不是vsftpd配置错误的话,服务都不起来的啊。
vsftpd.pam不是很懂,去哪儿有的copy??
急啊~~~~~
作者: xuhehao    时间: 2005-01-14 15:49
标题: 请教redhat as 3.0 的ftp开通和xmanager连接问题
恭喜搞定xfs
vsftpd的问题我还是认为是服务配置的问题,因为你提到过service vsftpd stop出现错误&netstat -an|grep 21没listen,这证明vsftpd没启动起来,不知道为什么你检查系统日志没问题。。。
不过个人感觉肯定与vsftpd.pam无关,因为服务都灭启动的说。。

不知则问,不能则学,虽能必让,然后为德




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2