Vsftpd-Ubuntu 安装&配置

  • 简述


Vsftpd(very secure FTP daemon)是一款在Linux发行版中最受推崇的ftp Server程序。特点是小巧轻快,安全易用。

  • 安装


$ sudo apt-get install vsftpd


  • Vsftpd的开启与关闭


$ sudo service vsftpd stop        # Stopping FTP server
$ sudo service vsftpd start       #Starting FTP server


  • 测试登录


$ ftp localhost
Connected to localhost
220 ( vsFTPd 3.0.2 )
Name (localhost:XXX):_____#在此处输入当前用户名
333 Please specify the password.
Password:_____#此处输入当前用户的密码
230 Login successful.  #不出意外,你就可看到这样的提示
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>  #等待执行Ftp命令。(输入ls可看到HOME目录)
ftp> quit/exit #两个都可以执行退出命令

#如果不能连接服务器,首先检查服务器是否正在运行:
$ ps –ef | grep vsftp
…….
#接着检查ftp主目录的访问权限是否为755
$ ls –ld /home/ftp
…….


  • 运行模式


      1.独立模式  

       将vsftpd.conf中的listen=NO 改为 listen=YES ,Ubuntu linux就可以设置vsftpd在独立模式下运行。

     2.普通模式

      如果希望它在普通模式下工作,就需要安装Xinetd超级服务器。

$ sudo apt-get install xinetd
$ sudo vi /etc/xinetd.conf
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/vsftpd
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
disable = no
}


$ sudo service xinetd start



  • vsftpd.conf


vfstpd.conf 的可按自己需求来更改。更改之前请先man

$ man vsftpd.conf #查看vsftpd配置文件说明
#以下内容详见 en_US vsftpd.conf(5)
                               zh_CN vsftpd.conf(5)




Name

vsftpd.conf - config file for vsftpd

Description

vsftpd.conf may be used to control various aspects of vsftpd's behaviour. By default, vsftpd looks for this file at the location /etc/vsftpd/vsftpd.conf. However, you may override this by specifying a command line argument to vsftpd. The command line argument is the pathname of the configuration file for vsftpd. This behaviour is useful because you may wish to use an advanced inetd such as xinetd to launch vsftpd with different configuration files on a per virtual host basis.

Format

The format of vsftpd.conf is very simple. Each line is either a comment or a directive. Comment lines start with a # and are ignored. A directive line has the format:
option=value
It is important to note that it is an error to put any space between the option, = and value.

Each setting has a compiled in default which may be modified in the configuration file.

Boolean Options

Below is a list of boolean options. The value for a boolean option may be set to YES or NO.
allow_anon_ssl
Only applies if ssl_enable is active. If set to YES, anonymous users will be allowed to use secured SSL connections.

Default: NO


anon_mkdir_write_enable
If set to YES, anonymous users will be permitted to create new directories under certain conditions. For this to work, the option write_enable must be activated, and the anonymous ftp user must have write permission on the parent directory.
Default: NO


anon_other_write_enable
If set to YES, anonymous users will be permitted to perform write operations other than upload and create directory, such as deletion and renaming. This is generally not recommended but included for completeness.
Default: NO


anon_upload_enable
If set to YES, anonymous users will be permitted to upload files under certain conditions. For this to work, the option write_enable must be activated, and the anonymous ftp user must have write permission on desired upload locations. This setting is also required for virtual users to upload; by default, virtual users are treated with anonymous (i.e. maximally restricted) privilege.
Default: NO



  • 其他


其实linux ftp服务器的搭设由于有了很多优秀的软件和文档而非常简单,大家只需按照文档指导和自己的需求来定制。最后放出一些比较好的参考链接:Vsftpd-Ubuntu 中文百科

你可能感兴趣的:(程序猿)