如何为 vsftpd 用户的上传设置默认组?
当我上传文件时,文件组设置为用户名...如何让它自动设置为特定组?
我需要 Linux (CentOS 5.5) 上的基本 FTP 服务器,没有任何安全措施,因为服务器和客户端位于测试 LAN 上,未连接到网络的其余部分,该网络本身在 NAT 防火墙后面使用不可路由的 IP没有对 FTP 的传入访问。
有些人推荐Vsftpd 而不是PureFTPd或ProFTPd。无论我尝试什么,我都无法允许匿名用户(即以“ftp”或“匿名”身份登录并输入任何字符串作为密码)上传文件:
# yum install vsftpd
# mkdir /var/ftp/pub/upload
# cat vsftpd.conf
listen=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
xferlog_file=YES
#anonymous users are restricted (chrooted) to anon_root
#directory was created by root, hence owned by root.root
anon_root=/var/ftp/pub/incoming
anon_upload_enable=YES
anon_mkdir_write_enable=YES
#chroot_local_user=NO
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
chown_uploads=YES
Run Code Online (Sandbox Code Playgroud)
当我从客户端登录时,这是我得到的:
500 OOPS:无法更改目录:/var/ftp/pub/incoming
我也试过“#chmod 777 /var/ftp/incoming/”,但得到同样的错误。
有人知道如何以最低安全性配置 Vsftpd 吗?
谢谢你。
编辑:SELinux 被禁用,这里是文件权限:
# cat /etc/sysconfig/selinux
SELINUX=disabled
SELINUXTYPE=targeted
SETLOCALDEFS=0
# sestatus …Run Code Online (Sandbox Code Playgroud) 我似乎找不到停止/重新启动 proftpd 的方法。我的服务器 IP 地址是 xx.yy.zz.ww 并且通过 FTP 从外部设备连接给我提示:
Connected to xx.yy.zz.ww
220 ProFTPD 1.3.1 Server (ProFTPD)
Run Code Online (Sandbox Code Playgroud)
然后它问我用户名。
当我尝试从同一台服务器(ftp localhost)连接时,会发生同样的事情。因此,我确定 proftp 正在我的服务器上运行。
另外,在我的服务器 (xx.yy.zz.ww) 上。我在拖尾/var/log/messages,它显示我打开和关闭了 FTP 会话。
我找不到 proftpd 是如何工作的。/etc/init.d/ 没有 proftpd ;/etc/xinetd.d/ 没有 proftpd。
我看了看:/etc/proftpd.conf它显示了我ServerType inetd
另外,当我运行时:ps -auxfww| grep proftp 我什么也没得到(除了我当前的命令)
我怎样才能知道 proftp 正在运行,我怎样才能杀死它/重新启动它?
我正在尝试在运行 Ubuntu 12.04 的服务器上使用虚拟用户设置 VSFTPD。我已将服务器配置为允许虚拟用户登录,但无法让它允许上传。我的 vsftpd.conf 如下:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
virtual_use_local_privs=YES
guest_enable=YES
guest_username=virtual
user_sub_token=$USER
local_root=/var/www/$USER
hide_ids=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Run Code Online (Sandbox Code Playgroud)
/etc/pam.d/vsftpd 包含:
auth required pam_pwdfile.so pwdfile /etc/vsftpd.passwd crypt=hash
account required pam_permit.so crypt=hash
Run Code Online (Sandbox Code Playgroud)
我设置了两个虚拟用户,其中一个与本地用户同名。他们每个人在 /var/www/ 中都有一个由“虚拟”拥有的目录。据我了解,当虚拟用户以这种方式登录时,他们将在系统中显示为虚拟用户。使用此配置用户可以登录,但不能上传文件。中给出的错误/var/log/vsftpd.log是:
Tue Nov 20 19:49:00 2012 [pid 2] CONNECT: Client "96.233.116.53"
Tue Nov 20 19:49:07 2012 [pid 1] [zac] OK LOGIN: Client "96.233.116.53"
Tue Nov 20 19:49:11 2012 [pid 2] CONNECT: Client "96.233.116.53"
Tue Nov 20 19:49:11 …Run Code Online (Sandbox Code Playgroud) 是否可以将 vsftpd 设置为仅接受来自特定 IP 地址集的连接?
我已经查看了 /etc/vsftpd.conf 的选项,但没有任何提示。说明书也没有。
我的服务器操作系统:红帽企业 Linux 服务器 6.5 版(圣地亚哥)
我安装了 vsftpd 并配置了它。当我尝试使用 Transmit 连接到 ftp 服务器时,它设法连接但挂在列表“/”上
然后,我收到一条消息:无法检索“/”的文件列表。控制连接超时。
跟我的iptables有关系吗?我的规则如下所列:
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
# You can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT
# Allows HTTP and HTTPS connections …Run Code Online (Sandbox Code Playgroud) 所以我在我的 Ubuntu 10.10 服务器上安装了 ProFTP。使用 FileZilla,我可以连接并进行身份验证,但无法获取目录列表。这是返回给我的最后几行:
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/home/todolist" is the current directory
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Error: Disconnected from server: ECONNABORTED - Connection aborted
Error: Failed to retrieve directory listing
Run Code Online (Sandbox Code Playgroud)
我没有更改配置中的任何内容,那么我应该更改/设置什么才能正确使用 FTP?
我的配置:
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#
# Includes DSO modules
Include /etc/proftpd/modules.conf
# Set off to …Run Code Online (Sandbox Code Playgroud) 根据此处的 Wiki ,您只能允许某些用户使用/etc/vsftp.conf文件中的以下配置通过 FTP 登录:
userlist_enable=YES
userlist_file=/etc/vsftp.user_list
userlist_deny=NO
Run Code Online (Sandbox Code Playgroud)
我已经将我的系统配置为使用此配置,并且我只有一个用户想要通过 FTP 公开streams,因此我/etc/vsftp.user_list看起来像这样:
streams
Run Code Online (Sandbox Code Playgroud)
有趣的是,一旦启用用户列表,我就无法登录。如果我更改userlist_enable为NO,则一切正常,但是如果我启用它,则无法全部登录,它只是不断尝试重新连接。我没有收到登录失败消息,它只是在使用lftp.
我的/etc/vsftp.conf文件位于引擎收录在这里我/etc/vsftp.user_list可以在这里。
我在这里做错了什么?我只想让streams用户能够登录。
启动服务器时返回此错误
Starting ftp server: proftpd2014-08-03 18:39:22,045 web-amd-3700-2gb proftpd[22126]: warning: unable to determine IP address of 'web-amd-3700-2gb'
2014-08-03 18:39:22,045 web-amd-3700-2gb proftpd[22126]: error: no valid servers configured
2014-08-03 18:39:22,045 web-amd-3700-2gb proftpd[22126]: fatal: error processing configuration file '/etc/proftpd/proftpd.conf'
failed!
Run Code Online (Sandbox Code Playgroud)
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
#
# Includes DSO modules
Include /etc/proftpd/modules.conf
# Set …Run Code Online (Sandbox Code Playgroud) 我有一个 Debian 专用服务器,我想使用 VSFTPD 在它上面启用隐式 SSL,但我遇到了困难。
我在网上阅读过,我唯一能找到的是如何启用 SSL,并且在手册页中它列出了一个隐式 ssl 命令。但由于隐式 ssl 使用第二个侦听器(默认为 990),我不知道如何使其在 Debian 上工作。
有没有人设法让这个工作?
这是我的配置:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
connect_from_port_20=YES
pam_service_name=vsftpd
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=NO
force_local_logins_ssl=NO
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
Run Code Online (Sandbox Code Playgroud)
如果我包含 Implicit_SSL=YES 服务器甚至不会启动。
谢谢