Ubuntu 上的 FTP 服务器

Ero*_*ocM 12 ftp

我正在为我的无头服务器寻找 FTP 服务器应用程序,这是一个具有公共 ip 地址的公共虚拟机。. 我把它缩小到 3,至少从我读过的内容来看是最熟练的。

  • vsftpd
  • proftpd
  • pure-ftp

我一直在研究所有 3 个,但我主要担心的是我需要一个可以上传但登录后看不到文件夹/目录内容的帐户。

我们一直filezilla在 Windows 服务器上使用服务器,但我们不得不转移到 Ubuntu。我以前没有安装过任何这些应用程序,我想知道它们是否在 Ubuntu 上支持这个。如果他们这样做,我将如何进行设置?

Fab*_*bby 7

我在vsftpd 内部服务器上使用,所以我只能回答那个......

vsftpd 基本上有两个参数来控制其目录列表 /etc/vsftpd.conf

dirlist_enable
    If set to NO, all directory list commands will give permission denied.

    Default: YES

dirmessage_enable
    If enabled, users of the FTP server can be shown messages when they 
    first enter a new directory. By default, a directory is scanned for
    the file .message, but that may be overridden with the configuration 
    setting message_file.

    Default: NO (but the sample config file enables it) 

download_enable
    If set to NO, all download requests will give permission denied.

    Default: YES 
Run Code Online (Sandbox Code Playgroud)

因此,在您的情况下,您绝对应该添加:

dirlist_enable=NO
Run Code Online (Sandbox Code Playgroud)

至少,根据您的用例,还要禁用下载和目录消息。(这就是我添加download_enable参数的原因,它并不真正控制任何目录列表)

来源: man vsftpd.conf

话虽如此,在公共服务器上,我不允许ftp再运行标准,但会使用类似sftp.


小智 6

如果你在这台机器上设置了 OpenSSH,你就为所有用户帐户内置了 sftp。大多数现代 ftp 客户端都内置了对 sftp 的支持。它也比常规 ftp 安全得多,并且使用加密的开销税最小。事实上,在我的本地网络上,sftp 比 ftp 快。试一试,它在与 ssh 相同的端口上运行,甚至可以在使用 ssh-key 登录时工作。

试一试,您还可以节省自己运行另一个进程的资源。

  • +1 使用 FTP 的唯一原因是出于遗留原因,即您期望客户端无法处理 SFTP。 (2认同)