linux FTP(VSFTP)架构配置详细教程
- 格式:doc
- 大小:117.50 KB
- 文档页数:13
Linux下FTP服务器的配置一:课程设计的目的及要求1、在Linux操作系统之上架设Vsftpd服务器并用自己的账号登录服务器,然后上传文件。
2、建立并配置一个虚拟的FTP服务器。
二:课程设计软硬件环境硬件环境:CPU:AMD内存:2.0GB软件环境:主机系统:Windows XP sp3 或者Windows 7Vmware Workstation 7.1.3build-324285虚拟机系统:RedHat Linux 9.0三:设计内容内容一:安装vsftpd1、启动虚拟机,启动系统进入RedHat Linux 9.02、查看Vsftp服务是否安装打开终端,如图所示:表示已安装vsftpd.如果未安装,从网上下载RPM软件包安装vsftpd命令如下:# rpm -ivh vsftpd-2.2.2-11.el6.i686.rpm如上图,安装系统时服务已经安装,因此省去安装步骤、内容二:配置vsftpd工作环境1、配置用户和目录(1)配置用户对于允许匿名访问的FTP服务器,应该在其主机中创建名为ftp的用户。
另外,还需检查是否有名为nobody的用户。
可使用以下命令检查,若不存在这些用户,需要另外创建。
检查是否存在nobody,命令如下,若存在,将显示下图所示的提示信息:使用下面的命令创建用户ftp,并设置其工作目录为/var/ftp(该目录在下面创建)#useradd -d /var/ftp ftp(2)配置目录对于ftp服务器来说,应该有一个公共目录供用户下载资料对于允许上传文件的FTP服务器,还应该设置具有上传权限的目录。
1)在/var目录中创建名为ftp的目录,命令如下:(如果已经存在该目录,则忽略此步)#mkdir /var/ftp2)使用以下命令修改目录ftp的所有者和权限:#chown root.root /var/ftp#chmod og-w /var/ftp(3)若允许匿名用户上传文件,应该创建一个供匿名用户上传文件的目录,并将该目录的所有者和组改为ftp,具体命令如下:#mkdir /var/ftp/upload#chown ftp.ftp /var/ftp/upload取消防火墙:#service iptables stop内容三启动vsftpd1、这里使用standalone方式启动vsftpd,需要修改文件:修改/etc/vsftpd/vsftpd.conf配置文件,将其中的listen=NO修改为listen=YES,表示使用独立方式侦听对ftp的访问,如图所示:在终端中输入命令打开配置文件:#vi /etc/vsftpd/vsftpd.conf保存退出。
redhat linux 下FTP配置。
(vsftp)1.启动vsftp:/sbin/service vsftpd start & (备注&代表再后台启动。
)2.查看是否启动,尝试登陆到FTP。
登陆FTP:ftp localhost 退出FTP:bye3.查看Linux IP :ifconfig在控制管理台下可看见如下代码:可以看出,IP Address 是:192.168.1.54.如果局域网内访问FTP不成功,IP 是开得,那么考虑可能是防火墙问题,关闭防火墙:Service iptables stop(也可以打开22、23等ftp端口)5、FTP所在根目录:/var/ftpvsftpd的文档结构其主配置文件只有一个:/etc/vsftpd/vsftpd.conf,所做的修改主要是围绕它进行,此外还有一些附加的文件,我将几个重要的说明如下:/etc/pam.d/vsftpd这里定义了采用pam的方式进行身份验证,它是根据/etc/vsftpd.ftpusers文件进行验证的,凡是在这个文件里面列出的用户无法登陆ftp/etc/er_list当配置文件vsftd.conf中的参数userlist_enable和userlist_deny设置为YES之后,此文件生效,凡是在此文件里面列出的用户就无法登陆ftp注:上面的两个文件看起来功能雷同,其实不然,vsftpd.ftpusers是采用外挂的PAM 程序进行验证时所需要的,而er_list则是vsftp本身的验证机制.也就是双重验证,无疑时更加安全.既然作用一样,所以这两个文件的内容也最好写的一样/etc/vsftpd.chroot_list此文件要自行建立,当vsftpd.conf中的参数chroot_list_enable和chroot_list_file启用后,此文件里面的用户就登陆ftp以后就只能在自己的主目录下活动,不能到处逛./var/ftp匿名用户登陆后的主目录首先查询是否安装vsftp[root@localhost root]# rpm -qa|grep vsftpdvsftpd-1.1.3-8现在就可以直接启动vsftp了启动[root@localhost root]# /etc/rc.d/init.d/vsftpd startStarting vsftpd for vsftpd: [ OK ]测试[root@localhost root]# ftp localhost //登陆Connected to localhost (127.0.0.1).220 (vsFTPd 1.1.3)Name (localhost:root):530 Permission denied.Login failed.ftp> bye //使用bye退出221 Goodbye.所以不用修改vsftpd里面的内容,就可以直接运行了.不过此时的效果是:匿名帐号anonymous可以登陆,主目录为/var/ftp,并且被锁定在此目录下.此账户只有下载权限系统的帐号(/etc/passwd文件中的帐号)可以登陆,并且没有锁定主目录任何在/etc/vsftpd.ftpusers文件中的帐号是无法登陆的上传和下载的日志信息保存在/var/log/vsftpd.log中所以一般这样就够我们用了,只是要注意把那些不允许登陆的帐号写到上面提到的两个文件中vsftpd.ftpusers和er_list不允许匿名登陆anonymous_enable=NO本地帐号下载的速度限制(单位B/S),如10KB/Slocal_max_rate=100000最大的并发连接数(同时连接的客户端数量),这里设置为10个max_clients=10每个IP最多多少个连接,这里设置为1max_per_ip=1我一直没找到如何限制总带宽,也就是说不限客户端数目,总带宽给他们平均分,同时连的人多每人得的带宽就少,连的人少每人得的带宽就多.还希望哪个能给小弟指点一下.不过我也想到这样,反正是限定了客户端的数量和每个客户端的下载速度,两者相乘就是服务器给它的最大带宽,虽然不灵活,但是也是变相的起到了限制总流量的作用了.我想一般ftp服务器也就用到这么多功能,最后必须要提到的是你要帐户能写,那个目录就要给账户开写的权限哦.6、由于匿名上传不会成功,所以配置上传用户:A、在etc 目录下more er_list和more ersB、vi er_listC、加一个#注释掉ROOT。
vsftp的配置步骤讲解说明主讲人:杨海艳然后vim /etc/vsftpd/vsftpd.confservice vsftpd restart【案例1】建立基于虚拟用户的FTP服务器,并根据以下要求配置FTP服务器。
(1)配置FTP匿名用户的主目录为/var/ftp/anon。
下载带宽限制为100kB/s(2)建立一个名为abc,口令为xyz的FTP账户。
下载带宽限制为500kB/s。
(3)设置FTP服务器同时登录到FTP服务器的最大链接数为100;每个IP最大链接数为3;用户空闲时间超过限值为5分钟。
mkdir /var/ftp/anonuseradd abcpasswd abcvim /etc/vsftpd/vsftpd.conf主要内容如下anonymous_enable=YESanon_root=/var/ftp/anonanon_max_rate=100000# Uncomment this to allow local users to log in.local_enable=YESlocal_max_rate=500000max_clients=100max_per_ip=3connect_timeout=300以上是本地的LOCAL用户下面是用虚拟用户来实现vim /etc/vsftpd/vuser内容如下tom123生成数据库文件db_load -T -t hash -f /etc/vsftpd/vuser /etc/vsftpd/vuser.dbchmod 600 /etc/vsftpd/vuser.dbvim /etc/pam.d/vsftpd注释掉原来的内容然后加入auth required pam_userdb.so db=/etc/vsftpd/vuseraccount required pam_userdb.so db=/etc/vsftpd/vuser最后编辑VSFTPD.CONF加入下面两句guest_enable=YESguest_username=abc大家可以自行测试。
linux ftp服务器的配置及各种知识点,本人亲自总结Linux FTP服务器的配置及各种知识点一、介绍Linux操作系统是一种常用的服务器操作系统,为了方便文件的传输和共享,我们可以通过配置FTP服务器来实现。
本文将介绍Linux FTP服务器的配置方法,并总结一些相关的知识点。
二、FTP协议FTP(File Transfer Protocol)是一种用于文件传输的协议。
它使用客户端-服务器架构,客户端通过FTP协议与服务器进行通信,实现文件的上传、下载和删除等操作。
三、FTP服务器的安装和配置1. 安装FTP服务器软件在Linux系统中,常用的FTP服务器软件有vsftpd、ProFTPd等。
我们可以通过包管理器安装这些软件,比如使用以下命令安装vsftpd: ```sudo apt-get install vsftpd```2. 配置FTP服务器- 打开FTP服务器配置文件通过以下命令打开vsftpd配置文件:```sudo nano /etc/vsftpd.conf```- 修改配置文件可以根据需求修改配置文件中的各项参数,以下是一些常用的参数:- anonymous_enable:启用匿名访问权限- local_enable:启用本地用户访问权限- write_enable:启用写权限- chroot_local_user:限制用户只能在自己的家目录下操作- 保存并关闭文件修改完配置文件后,按Ctrl+X组合键保存并关闭文件。
- 重启FTP服务器使用以下命令重启FTP服务器,使配置生效:```sudo service vsftpd restart四、FTP用户的创建和管理1. 创建FTP用户- 创建系统用户可以使用以下命令创建系统用户:```sudo adduser ftpuser```然后按照提示设置密码和其他相关信息。
- 设置用户的FTP目录创建用户后,可以为用户设置FTP目录,即用户在FTP服务器上的根目录。
linux下FTP服务(vsftp)的搭建与配置祥解注意:本文中绿色字体是linux命令行,//后面的文字为注释,黑色加粗是在linux中的输入,在linux下看不见的,其他为linux系统中的提示。
vsftpd的服务软件包位于RHED4的第1张光盘。
包名是vsftpd-2.0.1-5.i386.rpm,插入光盘。
#mount -t iso9660 /dev/cdrom /media/cdrom //挂载光盘mount: block device /dev/cdrom is write-protected, mounting read-only#cd /media/cdrom/RedHat/RPMS#ls vsftpd* //查找软件包vsftpd-2.0.1-5.i386.rpm#rpm -ivh vsftpd-2.0.1-5.i386.rpm //安装软件包Preparing... ############################# ############## [100%]package vsftpd-2.0.1-5 is already installed#rpm -ql vsftpd | grep /etc //查看etc目录下的vsftpd相关文件/etc/logrotate.d/vsftpd.log/etc/pam.d/vsftpd/etc/rc.d/init.d/vsftpd //vsftpd的启动脚本文件/etc/vsftpd/etc/vsftpd.ftpusers/etc/er_list/etc/vsftpd/vsftpd.conf //配置文件#grep -v '#' /etc/vsftpd/vsftpd.conf //查看ftp默认的配置anonymous_enable=YES //允许匿名登录local_enable=YES //允许本地用户登录write_enable=YES //对本地用户有写入的权限local_umask=022dirmessage_enable=YESxferlog_enable=YESconnect_from_port_20=YES //ftp服务器启用ftp端口连接请求xferlog_std_format=YESpam_service_name=vsftpd //PAM认证服务的配置文件名称,该文件保存在/etc/pam.d/目录下userlist_enable=YES //检查userlist_file文件指定的用户是不可以访问vsftpd,/etc/er_listlisten=YES //Ftp服务器处于独立启动模式tcp_wrappers=YESuserlist_enable =YES //设置使用er_list文件userlist_deny =YES //设置使用er_list文件用户设置禁用帐号#head -5 /etc/vsftpd.ftpusers //此文件保存不允许进行登录的本地用户Users that are not allowed to login via ftprootbin //这些用户不时普通的用户,都是系统中具有较高权限的帐号daemonadm#grep -v '#' /etc/er_list //查看er_list文件中不可访问ftp服务的用户rootbindaemonadmlpsyncshutdownhaltmailnewsuucpoperatorgamesnobody#ls -l /etc/init.d/vsftpd* //查看vsftpd的启动文件-rwxr-xr-x 1 root root 1880 2004-10-04 /etc/init.d/vsftpd #chkconfig --list vsftpd //查看vsftpd的运行级别vsftpd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭#chkconfig --level 35 vsftpd on //设置vsftpd的启动运行级别3和5中自动启动#chkconfig --list vsftpdvsftpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关闭#service vsftpd status //查看vsftpd的运行状态vsftpd 已停#service vsftpd start //开启vsftpd服务器为 vsftpd 启动 vsftpd: [ 确定 ]#service vsftpd restart //重新启动vsftpd服务器关闭 vsftpd: [ 确定 ]为 vsftpd 启动 vsftpd: [ 确定 ]#service vsftpd stop //停止vsftpd服务器关闭 vsftpd: [ 确定 ]#service vsftpd start //启动vsftpd服务器为 vsftpd 启动 vsftpd: [ 确定 ]#ftp 192.168.80.202 //测试vsftpd服务器Connected to 192.168.80.202.220 (vsFTPd 2.0.1)530 Please login with USER and PASS.530 Please login with USER and PASS.KERBEROS_V4 rejected as an authentication typeName (192.168.80.202:root):ftp(或anonymous) //匿名用户登录可使用ftp或anonymous 也可用本地用户331 Please specify the password.Password:**************//使用邮箱作为密码:**************230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp>ls //ls查看当前的目录测试成功227 Entering Passive Mode (192,168,80,202,224,106)150 Here comes the directory listing.drwxr-xr-x 2 0 0 4096 Oct 04 2004 pub226 Directory send OK.ftp>bye //bye退出ftp服务器221 Goodbye.linux下添加ftp用户和创建ftp虚拟用户#useradd -g ftp -s /bin/nolongin test //创建test用户,不让用户登录系统 test属于ftp组# passwd test //给test用户创建密码Changing password for user test.New UNIX password:1234567 //输入密码:1234567Retype new UNIX password:1234567 //确认输入密码:1234567passwd: all authentication tokens updated successfully.vsftpd虚拟用户帐号的设置过程:#vi login.txt //创建虚拟用户口令文件,文件内容如下mike1234567john1234567#db_load -T -t hash -f login.txt /etc/vsftpd/vsftpd_login.db//用db_load命令生成认证文件,-f 虚拟用户口令文件,即login.txt,生成的认证文件名vsftpd_login.db,该文件存放在/etc/vsftpd/目录中#file /etc/vsftpd/vsftpd_login.db//查看vsftpd_login.db的文件类型/etc/vsftpd/vsftpd_login.db: Berkeley DB (Hash, version 8, native byte-order)#chmod 600 /etc/vsftpd/vsftpd_login.db //设置文件vsftpd_login.db权限,对root用户可读可写#ls -l /etc/vsftpd/vsftpd_login.db-rw------- 1 root root 12288 1月21 22:24 /etc/vsftpd/vsftpd_login.db#vi /etc/pam.d/vsftpd.vu//创建虚拟用户认证所需的PAM 文件vsftpd.vu,如下内容auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login # cat /etc/pam.d/vsftpd.vu //查看vsftpd.vuauth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login # useradd -d /home/ftptest ftpuser //建立虚拟的系统用户帐号帐号名 ftpuser 宿主录/home/ftptest# chmod 700 /home/ftptest/ //设置目录权限700让后设置vsftpd.conf配置文件,在修改配置文件前对其进行备份#cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak //备份vsftpd.conf#vi /etc/vsftpd/vsftpd.conf//在vsftpd.conf配置文件中添加虚拟用户配置项内容如下:guest_enable=YESguest_username=virtualpam_service_name=vsftpd.vu#service vsftpd restart //重新启动vsftpdfuwuqi#ftp 192.168.80.202 //登录ftp服务器Connected to 192.168.80.202.220 (vsFTPd 2.0.1)530 Please login with USER and PASS.530 Please login with USER and PASS.KERBEROS_V4 rejected as an authentication typeName (192.168.80.202:root): mike //用mike用户进行登录331 Please specify the password.Password:1234567 //密码:1234567230 Login successful. //230显示登录成功Remote system type is UNIX.Using binary mode to transfer files.ftp> bye //bye退出ftp服务器对vsftpd虚拟用户设置不同的权限#vi /etc/vsftpd/vsftpd.conf //编辑vsftpd.conf文件添加如下内容:user_config_dir=/etc/vsftpd_user_conf //设置用户配置文件的保存目录#mkdir /etc/vsftpd_user_conf //创建虚拟用户配置文件的保存目录#vi /etc/vsftpd_user_conf/mike //创建mike用户配置文件,添加以下内容:anon_world_readable_only=NO //mike表示用户可以浏览Ftp目录和下载文件anon_upload_enable=YES //mike用户可以上传文件anon_mkdir_write_enable=YES //mike用户具有建立和删除目录的权限anon_other_write_enable=YES //mike用户具有文件改名和删除文件的权限。
Linux VSFTP服务器详细配置Ip207vsftp config文档一、配置vsftp服务器#vi /etc/vsftpd/vsftpd.confFor personal use only in study and research; not for commercial use<1>第7行:控制匿名登录anonymous_enable=YES 改成NO<2>第10行:允许本地帐号登录<3>第13行:控制可写权限<4>第17行:控制本地文件的权限掩码<5>第22行:控制是否允许匿名上传(与26行同时开启或关闭)<6>第26行:控制是否允许匿名写及创建目录的权限<7>第33行:控制上传或下载的日志记录<8>第46行:控制日志的保存路径<9>第52行:设置指令超时的时间,默认为600秒<10>第55行:设置数据连接的超时时间,默认为120秒<11>第91行:控制登录FTP的用户是否被限制在家目录下;(必须与93行同时开启或关闭)chroot_list_enable=YES<12>第93行:登录FTP后被限制在家目录下的用户列表文件chroot_list_file=/etc/vsftpd/chroot_list在/etc目录下新建一个vsftpd/chroot_list文件,内容加入要限制用户的用户名没加入限制用户可以访问其目录<13>第99行:控制登录FTP后是否允许ls命令<14>第102行:启用/etc/vsftpd/user_list文件2.配置匿名登录#vi /etc/vsftpd/vsftpd.conf第7行,设置为:(默认值)anonymous_enable=YES启动vsftpd服务器:#service vsftpd restart#service iptables stop匿名登录的默认目录:/var/ftp/pub打开匿名上传和写权限:#vi /etc/vsftpd/vsftp.conf激活第22行激活第26行打开默认共享目录的权限#chmod 777 /var/ftp/pub备注:匿名可以上传下载,但不能删除;3.本地帐号登录<1>禁用匿名登入修改配置文件#vi /etc/vsftpd/vsftpd.conf禁用所有匿名控制行,如:禁用第7行,第22行,第26行;<2>开放那些用户可以登入和那些用户拒绝登入#vi /etc/vsftpd/vsftpd.conf在102行后,插入如下:userlist_deny=NO(备注:设置/etc/er_list文件中的用户可登录FTP)保存退出俄如果是#userlist_deny=NO 注释掉,则默认全部用户可以登入FTP,当要限某用户不能登入:把用户名加入这个文件当中/etc/vsftpd.ftpusers,则这个用户名拒绝登入FTP创建用户并加入到相应的控制文件中useradd -s /sbin/nologin viong#useradd us1#useradd us2#passwd us1#passwd us2允许登录到FTP的用户:#echo us1>>/etc/er_list#echo us2>>/etc/er_list启动FTP服务器:#service vsftpd restart备注:帐号登录FTP,默认是登录在家目录下;禁止登录到FTP的用户:#echo us3>>/etc/vsftpd.ftpusers<3>将登录后的用户限制在本地家目录下:#vi /etc/vsftpd/vsftpd.conf激活第91行及第93行chroot_list_enable=YESchroot_list_file=/etc/vsftpd.chroot_list新建受限用户的列表文件并加入受限用户名#vi /etc/vsftpd.chroot_listus2保存退出#service vsftpd restart<4>限制匿名上传的速度:#vi /etc/vsftpd/vsftpd.conf:$anon_max_rate=5000 //默认以字节为单位5000表示5K速度<5> 限制本地帐号的上传速度:local_max_rate=5000 //以(字节/秒)为单位<6> 针对不同的使用者限制不同的速度(这个速度优先限制所有用户的速度):#vi /etc/vsftpd/vsftpd.conf 增加下面一行user_config_dir=/etc/vsftpd/userconf#mkdir /etc/vsftpd/userconf 创建一个目录#vi /etc/vsftpd/userconf/user1 (user1是要限制速度的用户名)local_max_rate=25000<7>定制欢迎信息:#vi /etc/vsftpd/vsftpd.conf激活80行ftpd_banner=Welcome to Huayu FTP service.<8>限制服务器连接数和同IP连接数1、max_clients可使用这个参数定义最大的总联机数。
Linux操作系统如何安装配置FTP一、安装FTP首先,您需要在Linux系统上安装FTP服务器软件。
在本例中,我们将使用vsftpd作为FTP 服务器软件。
您可以使用以下命令在CentOS上安装vsftpd:sudo yum install vsftpd二、配置FTP接下来,您需要编辑vsftpd的配置文件。
在CentOS上,vsftpd的配置文件位于/etc/vsftpd/vsftpd.conf。
您可以使用以下命令编辑此文件:sudo vi /etc/vsftpd/vsftpd.conf您需要按照以下步骤进行配置:1、设置FTP服务器使用的端口。
默认情况下,vsftpd使用的端口是21,但是您可以通过设置listen_port选项来使用其他端口:listen_port=212、禁用匿名访问。
如果您不想允许匿名用户访问FTP服务器,请设置anonymous_enable选项为NO:anonymous_enable=NO3、启用虚拟用户。
虚拟用户是指不在系统用户列表中的用户,而是由FTP服务器本身管理的用户。
要启用虚拟用户,请设置以下选项:virtual_users=YESuser_config_dir=/etc/vsftpd/vusers这将告诉vsftpd从/etc/vsftpd/vusers目录中读取每个虚拟用户的配置文件。
4、启用虚拟用户的写入权限。
默认情况下,虚拟用户没有写入权限。
要允许虚拟用户上传文件,请设置以下选项:write_enable=YESvirtual_use_local_privs=YESguest_enable=YESguest_username=ftpchroot_local_user=YES这将为虚拟用户启用本地权限,并使用ftp作为guest用户的用户名。
同时,chroot_local_user选项将限制用户只能访问其主目录。
三、授权接下来,您需要为虚拟用户授权。
linux 系统下FTP服务器配置方法linux系统下ftp服务器配置方法安装vsftprhel4系统中包含了vsftp服务器的rpm安装包,纸盒名称就是vsftpd-2.0.1-5.i386.rpm#rpmcivhvsftpd-2.0.1-5.i386.rpm2、vsftpd服务器的基本布局vsftpd服务器的配置文件保存在“/etc”目录和它的子目录中。
(1)vsftpd.conf文件中的布局项vsftpd.conf文件中所有的配置记录都包括配置项和配置值两部分内容,中间用等号连接。
anonymous_enable=yes(2)vsftpd服务器的默认配置vsftpd.conf文件中的预设布局采用于最为常用的ftp服务器布局市场需求,除去注解行后的配置文件中包含如下布局内容:#grepcv‘#’vsftpd/vsftpd.confanonymous_enable=yeslocal_enable=yeswrite_enable=yeslocal_umask=022dirmessage_enable=yesxferlog_enable=yesconnect_from_port_20=yesxferlog_std_format=yespam_service_name=vsftpduserlist_enable=yeslisten=yestcp_wrappers=yeslvsftpd.conf文件中的预设布局的含义如下:lanonymous_enable=yes,表示ftp可以允许匿名登陆llocal_enable=yes,则表示容许本地用户进占lwrite_enable=yes,表示ftp服务器开放对本地用户的写权限llocal_umask=022,设置本地用户的文件分解成掩码ldirmessage_enable=yes,当切换到ftp服务器中的某个目录时,将显示该目录下的“.message”隐含文件了内容lxferlog_enable=yes,ftp将投入使用上载和浏览日志lconnect_from_port_20=yes,ftp将启用ftp数据端口的连接请求lxferlog_std_format=yes,ftp将采用标准的ftpdxferlog日志格式lpam_service_name=vsftpd,设置pam认证服务的配置文件名称,该文件保存在“/etc/pam.d/”目录下。
linux下架设FTP服务器(vsftpd)这两天在LINUX下架设了FTP服务器,详细步骤和大家共享一下我的LINUX发行版本是fora14, FTP采纳vsd RPM包形式! 1、安装RPM 包 yum install vsftpd 这样安装比较便利,不用用户太多的配置在安好该服务之后,用户可以通过修改/etc/rc.d来设置让其是否开机自动运行也可以通过 /etc/vsftpd/vsftpd.conf The defaultcompiled in settings are fairly parano. This sample file loosens things up a bit, to make the ftp daemon usable. Please see vsftpd.conf.5 for all compiled in defaults. READ THIS: This ample 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 bydefault if you comment this out). anonymous_=YES 是否允许匿名用户登陆FTP 服务器 Uomment this to allow local users to log in. local_enable=YES 是否允许本地用户登陆FTP 服务器,其能正常登陆还需要看pam的配置状况 Uncomment this to enable any fo of FTP command. write_enable=YES 仅仅表示vsftpd接受写,能为操作胜利还需要看权限设置状况,但设为NO之后,客户端将不能上传文件 Default for local users is 077. You may wish to change this to 022, if your users expect that (022 is u 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. Ao, 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__write_enable=YES 表示匿名用户可以创建子名目 Activate directory messages - messages given to remote第1页共5页。
Linux FTP 服务器配置简单说明Linux FTP 服务器配置简单说明一. FTP 说明linux 系统下常用的FTP 是vsftp, 即Very Security File Transfer Protocol. 还有一个是proftp(Profession ftp。
我们这里也是简单的说明下vsftp的配置。
vsftp提供3种远程的登录方式:(1)匿名登录方式就是不需要用户名,密码。
就能登录到服务器电脑里面(2)本地用户方式需要帐户名和密码才能登录。
而且,这个帐户名和密码,都是在你linux系统里面,已经有的用户。
(3)虚拟用户方式同样需要用户名和密码才能登录。
但是和上面的区别就是,这个用户名和密码,在你linux系统中是没有的(没有该用户帐号二. Vsftp的安装配置 2.1 安装 vsftp 的安装包,可以在安装里找到。
用yum 安装过程也很简单。
具体参考: Linux 搭建 YUM 服务器/tianlesoftware/archive/2011/01/03/6113902.aspx 安装命令:yum install vsftpd 2.2. 相关命令 2.2.1 启动与关闭 [root@singledb ~]# service vsftpd start Starting vsftpd for vsftpd: [ OK ] [root@singledb ~]# service vsftpd stop Shutting down vsftpd: [ OK ] [root@singledb ~]# service vsftpd restart Shutting down vsftpd: [FAILED] Starting vsftpd for vsftpd: [ OK ] [root@singledb ~]# /etc/init.d/vsftpd start Starting vsftpd for vsftpd: [FAILED] [root@singledb ~]# /etc/init.d/vsftpd stop Shutting down vsftpd: [ OK ] [root@singledb ~]# /etc/init.d/vsftpd restart Shutting down vsftpd: [FAILED] Starting vsftpd for vsftpd: [ OK ] [root@singledb ~]# /etc/init.d/vsftpd status vsftpd (pid 3931 is running... [root@singledb ~]# 2.2.2. 其他命令 --查看vsftpd 启动状态 [root@singledb ~]# chkconfig --list vsftpd vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@singledb ~]# chkconfig vsftpd on [root@singledb ~]# chkconfig --list vsftpd vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off 这里看到,默认情况下从2到5设置为on 了。
1、vsftpd安装[root@linux01 ~]# mkdir /media/cdrom[root@linux01 ~]# mount -t iso9660 /dev/cdrom /media/cdrom # 挂载镜像mount: block device /dev/cdrom is write-protected, mounting read-only[root@linux01 ~]# cd /media/cdrom/Server # 进入软件包目录[root@linux01 Server]#[root@linux01 Server]# rpm -qa | grep ^vsftpd # 查询相关已经安装的软件包[root@linux01 Server]# ls | grep vsftpd* # 查询当前路径下安装包vsftpd-2.0.5-12.el5.i386.rpm[root@linux01 Server]# rpm -ivh vsftpd-2.0.5-12.el5.i386.rpm # 安装软件包i安装v输出详细信息h进度warning: vsftpd-2.0.5-12.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186Preparing... ########################################### [100%]1:vsftpd ########################################### [100%] [root@linux01 Server]# rpm -qa | grep ^vsftpd # 再次查询相关已经安装的软件包vsftpd-2.0.5-12.el5[root@linux01 Server]#cd[root@linux01 ~]# rpm -ql vsftpd | grep etc # 查询etc中与vsftpd相关的文件/etc/logrotate.d/vsftpd.log/etc/pam.d/vsftpd/etc/rc.d/init.d/vsftpd/etc/vsftpd/etc/vsftpd/ftpusers/etc/vsftpd/user_list/etc/vsftpd/vsftpd.conf/etc/vsftpd/vsftpd_conf_migrate.sh[root@linux01 ~]#2、、/etc/vsftpd/vsftpd.conf文件配置[root@linux01 Server]# cat /etc/vsftp/vsftpd.conf # 读取原文,默认配置cat: /etc/vsftp/vsftpd.conf: No such file or directory[root@linux01 Server]# cat /etc/vsftpd/vsftpd.conf# 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 # 显示目录下的.message## Activate logging of uploads/downloads.xferlog_enable=YES # 启用上传和下载日志## Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES # 启用FTP数据端口## 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 # 使用标准的ftpd xferlog日志格式## 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# 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 # FTP服务器处于独立启动模式(相对于受xinnetd管理的启动模式)## 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=YESpam_service_name=vsftpd # PAM认证服务的配置文件名称,/etc/pam.d/vsftpd userlist_enable=YES # FTP将检查userlist_file(/etc/vsftpd/user_list)中用户是否可以访问FTP服务器tcp_wrappers=YES # 使用tcp_wrappers作为主机访问控制方式,/etc/host.allow和/etc/hosts.deny。