vsftpd linux看不到文件,ubuntu下解决vsftpd不能上传文件的问题

ubuntu下解决vsftpd不能上传文件的问题

这个问题很多同学都会遇到下面简单的把

我解决这个问题的步骤说下,希望对大家有所帮助:

首请看我的vsftpd的配置文件:(当然您可以把他复制过去.我也是在网上看到强人的贴子有所修改过来的)

========================================

# Example config file /etc/vsftpd/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 on some FTP servers, ASCII support allows a denial of service

# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd

# predicted this attack and has always been safe, reporting the size of the

# raw file.

# ASCII mangling is a horrible feature of the protocol.

#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

file:///G|/Users/admin88/Desktop/vsftpd不能上传文件.txt[2012/5/16 14:25:23]

# the presence of the "-R" option, so there is a strong case for enabling it.

#ls_recurse_enable=YES

#

# When "listen" directive is enabled, vsftpd runs in standalone mode and

# listens on IPv4 sockets. This directive cannot be used in conjunction

# with the listen_ipv6 directive.

listen=YES

#

# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6

# sockets, you must run two copies of vsftpd whith two configuration files.

# Make sure, that one of the listen options is commented !!

#listen_ipv6=YES

pam_service_name=vsftpd

#userlist_enable=YES

tcp_wrappers=YES

========================================

1. 500 OOPS: cannot change directory 错误的解决办法

#userlist_enable=YES 把这里的加上.

2. 550 Create directory operation failed.错误的解决办法

anonymous_enable=YES

write_enable=YES

其实只要把我conf文件复制过去然后

sudo /etc/init.d/vsftpd restart一下

接下来的操作很关键

比如说你想在var下创建一个www文件然后admin这个用户可以往这个文件里面上传东西。也就是你给vsftpd一

个虚拟用户并指定他可以访问的文件夹.那么你需要这样做:

sudo mkdir /var/www

sudo useradd -d /var/www admin

sudo chmod 755 /var/www

sudo passwd admin

sudo chown admin.ftp /var/www

这样应该就可以完成给vsftpd一个虚拟用户并指定他可以访问的文件夹

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: vsftpd是一款常用的FTP服务器软件,其配置文件位于/etc/vsftpd.conf。 该配置文件包含了许多参数,可以通过修改这些参数来定制FTP服务器的行为。以下是一些常用的参数: - anonymous_enable:是否允许匿名用户登录FTP服务器,默认为YES。 - local_enable:是否允许本地用户登录FTP服务器,默认为YES。 - write_enable:是否允许用户上传文件到FTP服务器,默认为YES。 - chroot_local_user:是否将用户限制在其主目录下,默认为NO。 - pasv_enable:是否启用被动模式,默认为YES。 - pasv_min_port和pasv_max_port:指定被动模式下使用的端口范围。 需要注意的是,修改配置文件后需要重启vsftpd服务才能生效。可以使用以下命令重启服务: sudo systemctl restart vsftpd ### 回答2: vsftpd是一个常用的FTP服务器,常用于Linux系统中进行FTP文件传输。其配置文件为/etc/vsftpd.conf,下面是该配置文件的详细说明: 1. 全局设置:全局设置是指整个FTP服务器的全局属性,它涉及着整个FTP服务器的构建与管理。 - anonymous_enable:启用或禁用匿名访问。默认值为YES,允许匿名访问,需要禁用时将值修改为NO。 - local_enable:启用或禁用本地用户访问。默认值为YES,允许本地用户访问,需要禁用时将值修改为NO。 - write_enable:启用或禁用写入权限。默认值为YES,允许写入,需要禁用时将值修改为NO。 - chroot_local_user:启用或禁用虚拟用户所在目录的根目录。默认值为NO,不开启虚拟用户的根目录,需要开启时将值修改为YES。 - pasv_min_port:指定FTP服务器被动模式下的最小端口值。 - pasv_max_port:指定FTP服务器被动模式下的最大端口值。 2. 用户设置:用户设置是指FTP服务器对不同用户的不同属性设置进行配置。 - userlist_file:用户列表文件,用于指定FTP服务器允许或不允许登录的用户。 - local_umask:指定本地用户的文件创建和编辑时的默认文件掩码。 - anon_upload_enable:启用或禁用匿名上传权限。默认值为NO,不允许匿名上传,需要开启时将值修改为YES。 - anon_mkdir_write_enable:启用或禁用匿名用户在服务器上创建目录的权限。默认值为NO,不允许匿名用户创建目录,需要开启时将值修改为YES。 - anon_other_write_enable:允许匿名用户以其他用户身份创建文件。默认值为NO,需要开启时将值修改为YES。 3. SSL/TLS设置:FTP服务器SSL/TLS安全传输协议的设定。 - ssl_enable:启用FTP SSL/TLS协议。默认值为NO,需要开启时将值修改为YES。 - ssl_ciphers:设置SSL/TLS通信中所使用的密码算法。 - ssl_tlsv1:启用或禁用TLSv1协议。 - ssl_sslv2:启用或禁用SSLv2协议。 - ssl_sslv3:启用或禁用SSLv3协议。 以上就是vsftpd的配置文件的详细说明。需要注意的是,配置文件的不同设置会对FTP服务器的整体性能产生直接和间接的影响,因此,在进行配置之前,需要充分考虑FTP服务器的实际情况和需求。 ### 回答3: 在Linux操作系统中,vsftpd是一种常见的FTP服务器软件,用于提供文件传输协议服务。在vsftpd的配置过程中,配置文件是非常重要的一部分,通过对该文件的配置可以实现更加细致的管理和控制。下面将详细介绍Linuxvsftpd的配置文件。 1. 配置文件名称 在Linux系统中,vsftpd的配置文件名称为“/etc/vsftpd/vsftpd.conf”,该文件通常保存在/etc/vsftpd目录下。如果没有该目录,可以使用命令“sudo apt-get install vsftpd”安装vsftpd服务,该操作会自动创建vsftpd目录及其配置文件。 2. 配置文件的结构 vsftpd的配置文件采用“键值对”(key=value)的形式进行配置,而且不区分大小写,也不允许使用#、;等符号来表示注释。配置文件可以分为全局参数、匿名用户参数、本地用户参数等几个部分。 3. 全局参数 全局参数可以影响所有用户,常用的参数有: - listen_port:FTP服务监听端口,默认为21; - listen_ipv6:是否监听IPv6地址,默认为NO; - anonymous_enable:是否允许匿名用户登录,默认为YES; - local_enable:是否允许本地用户登录,默认为YES; - file_open_mode:上传的文件文件权限,默认为0666。 4. 匿名用户参数 匿名用户参数只影响匿名用户,常用的参数有: - anon_root:匿名用户的根目录,默认为/var/ftp; - anon_upload_enable:是否允许匿名用户上传文件,默认为NO; - anon_mkdir_write_enable:是否允许匿名用户创建文件夹,默认为NO。 5. 本地用户参数 本地用户参数只影响本地用户,常用的参数有: - write_enable:是否允许本地用户上传文件,默认为YES; - local_root:本地用户的根目录,默认为/home/FTP; - chroot_local_user:将用户限制在其主目录中,默认为YES。 6. 配置示例 下面是vsftpd配置文件的一个示例,其中包括了上述三部分的设置: ```sh # 全局参数 listen=YES tcp_wrappers=YES anonymous_enable=YES local_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES idle_session_timeout=600 data_connection_timeout=120 ftpd_banner=Welcome to my FTP server. # 匿名用户参数 anon_root=/var/ftp anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES # 本地用户参数 write_enable=YES local_root=/home/FTP chroot_local_user=YES allow_writeable_chroot=YES ``` 7. 总结 通过对vsftpd的配置文件进行设置,可以让FTP服务器的管理更加细致和安全。当然,在设置过程中需要注意到某些参数的设置可能会导致FTP服务器不能正常运行,因此需要进行谨慎的设置并进行测试。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值