Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1620202
  • 博文数量: 441
  • 博客积分: 20087
  • 博客等级: 上将
  • 技术积分: 3562
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-19 15:35
文章分类

全部博文(441)

文章存档

2014年(1)

2012年(1)

2011年(8)

2010年(16)

2009年(15)

2008年(152)

2007年(178)

2006年(70)

分类: LINUX

2007-08-28 16:55:17

How To setup vsftpd on Fedora Core 6

(1)按照以下方法操作


vsftpd stands for 'very secure ftp daemon' there is plenty of documentation about this ftp daemon from their .

Anything beyond the initial install and startup is left up to you to figure out from their site since the configuration options are all documented there.

We will once again use YUM to install and this is another very easy process:

 [root@unisys ~]# yum install vsftpd
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 1.9 MB 00:04
extras  : ################################################## 6118/6118
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vsftpd to pack into transaction set.
vsftpd-2.0.5-8.i386.rpm 100% |=========================| 16 kB 00:00
---> Package vsftpd.i386 0:2.0.5-8 set to be updated
--> Running transaction check
Dependencies Resolved
Package                 Arch       Version          Repository        Size
Installing:
vsftpd i386 2.0.5-8 core 137 k
Transaction Summary
 Install      1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
 Total download size: 137 k
Downloading Packages:
(1/1): vsftpd-2.0.5-8.i38 100% |=========================| 137 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: vsftpd ######################### [1/1]
 Installed: vsftpd.i386 0:2.0.5-8
Complete!
[root@unisys ~]#

Now all that needs to be done is for it to be started!

[root@unisys ~]# service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
[root@unisys ~]#


And thats it, you now have a FTP daemon running on your server, any user on the system (excluding root) can now login via FTP and be placed in their home directory, by default the daemon sets up a anonymous FTP with the docroot in /var/ftp/pub , if you want to serve files without authentication out ftp just place those files in /var/ftp/pub!

Enjoy!

-Scott D Harvanek


然后我们创建一个ftp用户
#useradd ftpuser
然后修改密码
#passwd ftpuser

密码修改完毕之后我们登录ftp服务器:

# ftp 192.168.1.111
可是你却发现总是欻现:
500 OOPS: cannot change directory:/home/user
Login failed.

下面我们来解决这一问题:
(2)查看ftp设置,将ftp_home_dir 选项打开
getsebool -a | grep ftp
setsebool -P ftp_home_dir on
getsebool -a | grep ftp
然后再来登录ftp服务器:
# ftp 192.168.1.111
Connected to 192.168.1.111.
220 Welcome to YBG's FTP service.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (192.168.1.111:root): ftpuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

好了,现在你就拥有一个服务器了,每当你在你的机器上用useradd添加一个用户的时候,你就可以通过这个用户名称来登录ftp服务器

总结起来就 下面几点:
(1) 安装vsftpd
      #yum install -y vsftpd
(2) 添加ftp用户,默认的root是不允许登录ftp服务器的
     #useradd ftpuser
     #passwd ftpuser
(3) 设定用户访问权限
    # setsebool -P ftp_home_dir on
(4)启动vsftpd服务
    # service vsftpd start


至于更为复杂的用户权限设置以及其它的需求配置,可以在网上搜索,参阅相关的文档。


阅读(1240) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~