我的任务是安装一个新的 SFTP 服务器。就其本身而言,这是一个非常简单的操作:简单地使用internal-sftp无处不在的 SSH 服务(使用 chrooting)的角色就足以拥有一个可靠的 SFTP 服务器。
然而,我的天性总是针对同一问题尝试至少两种不同的方法,并且我意识到我可以使用ProFTPDsftp 插件来做同样的事情,还有更细粒度的文件传输相关选项的额外好处(例如:带宽限制)。另一方面,这个插件默认没有编译(和捆绑),我想避免(也许)“测试较少”的解决方案。
目前,唯一需要的服务是 SFTP;但是,我正在提前玩,我想实施一个不仅可以与 SFTP 一起使用,而且还可以与 FTP/S 一起使用的解决方案。
考虑到我将 chroot 用户在家中,您认为什么是更好的解决方案?
internal-sftp和独立的 FTP 服务器(vsftpd或proftpd)提供 FTP/S 服务我似乎找不到停止/重新启动 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 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) 启动服务器时返回此错误
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) 使用proftpd您可以更改默认目录编辑/etc/proftpd.conf
DefaultRoot ~
更改为
DefaultRoot ~/music
我如何使用SFTP达到相同的结果?
顺便说一句,我使用的是 ubuntu lucid。
非常感谢您的帮助。
我有一个名为“ftp3”的用户,属于“ftpusers-temp”组。
该用户的主页是 home/FTP-shared/temp
在 proftpd.conf 中我有以下 2 个指令:
DefaultRoot /home/FTP-shared
DefaultRoot ~ ftpusers-temp
Run Code Online (Sandbox Code Playgroud)
我期望用户 ftp3 只能看到“temp”目录;但发生的情况是,登录时默认选择“temp”目录,但用户可以返回并访问 ftp 服务器的根目录。
用户“ftp3”不应该被囚禁在“/home/FTP-shared/temp”中,并且无法访问“/home/FTP-shared”吗?
是否可以使用 Proftpd 隐藏目录?
特别是 .svn 目录。
有HideFiles但没有HideDirectories指令。HideFiles 的问题在于它与完整路径不匹配。
<Directory /home/ftp_user/my_project >
# Despite trying to hide this directory it still shows up
# as /.svn in the ftp client.
HideFiles "^\.svn"
<Limit ALL>
allowuser ftp_user
</Limit>
</Directory>
Run Code Online (Sandbox Code Playgroud)
还有另一种隐藏目录的方法吗?
我已经编译了带有 ftp、ftps、sftp 和 mysql 身份验证的 proftpd 1.3.4d 版本。
到目前为止,我可以在同一时间对端口的工作210: ftp和ftpes和端口211的sftp。
ServerName "ProFTPD self contained package"
ServerType inetd
Port 211
UseIPv6 off
Umask 022
User nobody
Group nobody
allowOverwrite on
SystemLog none
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Global>
DefaultRoot ~
</Global>
<VirtualHost 0.0.0.0>
Port 210
SQLUserWhereClause " (allowed = 'both' OR allowed = 'ftp') "
</VirtualHost>
<IfModule mod_sftp.c>
<VirtualHost 0.0.0.0>
SFTPEngine on
SFTPLog none
Port 211
SFTPHostKey /etc/ssh/ssh_host_dsa_key
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPAuthorizedUserKeys file:../etc/ssh/authorized_keys
SQLUserWhereClause …Run Code Online (Sandbox Code Playgroud) 我已经创建了一个用户并分配了一个密码和组(新组)。问题是这个用户只有拥有shell才能登录FTP(proftpd)=/bin/bash
如果我将 shell 设置为/bin/falseProftpd 不会让他进入并提供 530 Login 错误响应。
我希望用户能够登录到 FTP 但没有其他访问权限,因此无法通过 SSH 登录。这/etc/proftpd.conf是所有默认值,它是 version 1.3.3e,它是 CentOS 6。
我有一个网络服务器,我们正在为顾问提供 FTP 访问权限。对于托管在该服务器上的一个域,他需要访问“dev”目录,而对于托管在该服务器上的不同域,他需要访问不同的目录。我正在尝试使用 VirtualHosts 进行设置,但我遇到了问题。这是我的 proftpd.conf 文件的 VirtualHost 位:
<VirtualHost www.example2.com>
ServerName "Example 2"
DefaultRoot /var/www/example2/dev
</VirtualHost>
<VirtualHost www.example1.com>
ServerName "Example 1"
DefaultServer on
DefaultRoot /var/www/example1
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
当我 FTP 到任一域时,我总是得到第一个 VirtualHost,即使我 FTP 到第二个域。