redhat 5.4 ftp服务器搭建故障处理

来源:互联网 发布:建个网络平台多少钱 编辑:程序博客网 时间:2024/05/21 14:53

请谨记,你的每一步操作都有可能导致系统的文件串改。。

1、能登录不能上传文件

C:\Users\Administrator.WIN-20121228FDJ>ftp 192.168.1.100Connected to 192.168.1.100.220 Welcome to blah FTP service @ forilen .User (192.168.1.100:(none)): anonymous331 Please specify the password.Password:230 Login successful.ftp> cd pub250 Directory successfully changed.ftp> put C:\Users\Administrator.WIN-20121228FDJ\Desktop\config.ini200 PORT command successful. Consider using PASV.553 Could not create file.ftp>
解决办法:(1)关闭selinux
[root@localhost ftpuser]# setenforce 0[root@localhost ftpuser]# service vsftpd restartShutting down vsftpd:                                      [  OK  ]Starting vsftpd for vsftpd:                                [  OK  ]
(1)关闭linux同时关闭启动selinux
vi /etc/sysconfig/selinux# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:#       enforcing - SELinux security policy is enforced.#       permissive - SELinux prints warnings instead of enforcing.#       disabled - SELinux is fully disabled.SELINUX=enforcing#SELINUX=disabled# SELINUXTYPE= type of policy in use. Possible values are:#       targeted - Only targeted network daemons are protected.#       strict - Full SELinux protection.SELINUXTYPE=targeted
2、匿名用户和本地用户家目录及权限问题

根据Linux用户最小权限原则,本地用户登录ftp服务器的家目录可以手动指定,anonymous的默认家目录貌似不能手动指定

本地用户家目录:vi /etc/vsftpd/vsftpd.conf

# 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=022local_root=/var/ftp/pub/ftpuser//本地用户家目录
匿名用户家目录:/var/ftp/,但是对于一般情况下,匿名用户如果是通过Windows系统的dos进入ftp服务器,默认路径是不能上传文件的,因为/var/ftp/的权限不够大
3、有时候遇到vsftpd远程开启失败,就需要手动开启
[root@livedvd ~]# setsebool ftp_home_dir 1[root@livedvd ~]# getsebool -a |grep ftpallow_ftpd_anon_write --> offallow_ftpd_full_access --> offallow_ftpd_use_cifs --> offallow_ftpd_use_nfs --> offftp_home_dir --> onftpd_connect_db --> offftpd_use_passive_mode --> offhttpd_enable_ftp_server --> offtftp_anon_write --> off[root@livedvd ~]# service vsftpd restartShutting down vsftpd:                                      [  OK  ]Starting vsftpd for vsftpd:                                [  OK  ]
如果[root@livedvd vsftpd]# getsebool -a |grep ftp   bash: /usr/sbin/getsebool: Input/output error,需要执行yum安装
[root@livedvd ~]# yum provides "*bin/setsebool"Loaded plugins: fastestmirror, refresh-packagekit, securitybase                                                     | 3.7 kB     00:00     base/primary_db                                          | 3.4 MB     00:27     extras                                                   | 3.5 kB     00:00     extras/primary_db                                        |  19 kB     00:00     updates                                                  | 3.4 kB     00:00     updates/primary_db                                       | 4.7 MB     00:40     base/filelists_db                                        | 4.9 MB     00:39     extras/filelists_db                                      |  10 kB     00:00     updates/filelists_db                                     | 3.9 MB     00:32     policycoreutils-2.0.83-19.30.el6.i686 : SELinux policy core utilitiesRepo        : baseMatched from:Filename    : /usr/sbin/setseboolpolicycoreutils-2.0.83-19.30.el6.i686 : SELinux policy core utilitiesRepo        : installedMatched from:Filename    : /usr/sbin/setsebool
12天倒计时ing ^ _ ^

原创粉丝点击