Tác giả Chủ đề: Install and Configure VSFTPD  (Đã xem 4543 lần)

0 Thành viên và 1 Khách đang xem chủ đề.

Ngủ rồi Admin

  • Administrator
  • Hero Member
  • *****
  • Bài viết: 707
  • Số Lần: +95/-0
    • http://vietnetwork.vn
Install and Configure VSFTPD
« vào: Tháng Ba 15, 2011, 05:17:09 PM »
[root@bigboy tmp]# service vsftpd start
[root@bigboy tmp]# service vsftpd stop
[root@bigboy tmp]# service vsftpd restart

To configure VSFTPD to start at boot, use the chkconfig command:
[root@bigboy tmp]# chkconfig vsftpd on

TESTING THE STATUS OF VSFTPD [root@bigboy root]# netstat -a | grep ftp
tcp 0 0 *:ftp *:* LISTEN
[root@bigboy root]#




 VSFTPD runs as an anonymous FTP server: Unless you want any
remote user to log into to your default FTP directory using a username of
anonymous and a password that’s the same as their e-mail address, I suggest
turning this off. You can set the configuration file’s anonymous_enable
directive to no to disable this feature. You’ll also need to simultaneously
enable local users to be able to log in by removing the comment symbol
(#) before the local_enable instruction.

VSFTPD allows only anonymous FTP downloads to remote
users, not uploads from them: You can change this by modifying the
anon_upload_enable directive shown later.

 VSFTPD doesn’t allow anonymous users to create directories on
your FTP server: You can change this by modifying the
anon_mkdir_write_enable directive.
☞ VSFTPD logs FTP access to the /var/log/vsftpd.log log file: You can
change this by modifying the xferlog_file directive.
☞ VSFTPD expects files for anonymous FTP to be placed in the
/var/ftp directory: You can change this by modifying the anon_root
directive. There is always the risk with anonymous FTP that users will
discover a way to write files to your anonymous FTP directory. You run
the risk of filling up your /var partition if you use the default setting. It is
best to make the anonymous FTP directory reside in its own dedicated
The configuration file is fairly straightforward as you can see in the snippet:
# Allow anonymous FTP?
# Uncomment this to allow local users to log in.
# Uncomment this to enable any form of FTP write command.
# (Needed even if you want local users to be able to upload files)
# Uncomment to allow the anonymous FTP user to upload files. This only
# has an effect if global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# Uncomment this if you want the anonymous FTP user to be able to
# new directories.
# Activate logging of uploads/downloads.
# You may override where the log file goes if you like.
# The default is shown# below.
# The directory which vsftpd will try to change
# into after an anonymous login. (Default = /var/ftp)
To activate or deactivate a feature, remove or add the # at the beginning
of the appropriate line.


Other vsftpd.conf Options
There are many other options you can add to this file:
☞ Limiting the maximum number of client connections (max_clients)
☞ Limiting the number of connections by source IP address (max_per_ip)
☞ Setting the maximum rate of data transfer per anonymous login
☞ Setting the maximum rate of data transfer per non-anonymous login
Descriptions on this and more can be found in the vsftpd.conf man

FTP Users with Read-Only Access to a Shared Directory In this example, anonymous FTP is not desired, but a group of trusted users need
to have read-only access to a directory for downloading files. Here are the steps:
1. Disable anonymous FTP. Comment out the anonymous_enable line in the
vsftpd.conf file:
# Allow anonymous FTP?
# anonymous_enable=YES
2. Enable individual logins by making sure you have the local_enable line
uncommented in the vsftpd.conf file:
# Uncomment this to allow local users to log in.
3. Start VSFTP.
[root@bigboy tmp]# service vsftpd start
4. Create a user group and shared directory. In this case, use /home/ftpusers
and a user group name of ftp-users for the remote users:
[root@bigboy tmp]# groupadd ftp-users
[root@bigboy tmp]# mkdir /home/ftp-docs
5. Make the directory accessible to the ftp-users group:
[root@bigboy tmp]# chmod 750 /home/ftp-docs
[root@bigboy tmp]# chown root:ftp-users /home/ftp-docs
6. Add users, and make their default directory /home/ftp-docs:
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user1
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user2
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user3
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user4
[root@bigboy tmp]# passwd user1
[root@bigboy tmp]# passwd user2
[root@bigboy tmp]# passwd user3
[root@bigboy tmp]# passwd user4
7. Copy files to be downloaded by your users into the /home/ftp-docs
8. Change the permissions of the files in the /home/ftp-docs directory to
read-only access by the group:
[root@bigboy tmp]# chown root:ftp-users /home/ftp-docs/*
[root@bigboy tmp]# chmod 740 /home/ftp-docs/*


 Users should now be able to log in via FTP to the server using their new
usernames and passwords. If you absolutely don’t want any FTP users to
be able to write to any directory, then you should set the write_enable line
in your vsftpd.conf file to no:
write_enable = NO
Remember, you must restart VSFTPD for the configuration file changes
to take effect.
Sample Login Session to Test Functionality
Here is a simple test procedure you can use to make sure everything is working
1. Check for the presence of a test file on the FTP client server.
[root@smallfry tmp]# ll
total 1
-rw-r–r– 1 root root 0 Jan 4 09:08 testfile
[root@smallfry tmp]#
2. Connect to Bigboy via FTP:
[root@smallfry tmp]# ftp
Connected to (
220 ready, dude (vsFTPd 1.1.0: beat me, break me)
Name ( user1
331 Please specify the password.
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
As expected, you can’t do an upload transfer of testfile to bigboy:
ftp> put testfile
local: testfile remote: testfile
227 Entering Passive Mode (192,168,1,100,181,210)
553 Could not create file.
But we can view and download a copy of the VSFTPD RPM on the FTP
server bigboy:
ftp> ls
227 Entering Passive Mode (192,168,1,100,35,173)
150 Here comes the directory listing.
-rwxr—– 1 0 502 76288 Jan 04 17:06 vsftpd-1.1.0-1.i386.rpm


 226 Directory send OK.
ftp> get vsftpd-1.1.0-1.i386.rpm vsftpd-1.1.0-1.i386.rpm.tmp
local: vsftpd-1.1.0-1.i386.rpm.tmp remote: vsftpd-1.1.0-
227 Entering Passive Mode (192,168,1,100,44,156)
150 Opening BINARY mode data connection for vsftpd-1.1.0-
1.i386.rpm (76288 bytes).
226 File send OK.
76288 bytes received in 0.499 secs (1.5e+02 Kbytes/sec)
ftp> exit
221 Goodbye.
[root@smallfry tmp]#
As expected, an anonymous FTP fails:
[root@smallfry tmp]# ftp
Connected to (
220 ready, dude (vsFTPd 1.1.0: beat me, break me)
Name ( anonymous
331 Please specify the password.
530 Login incorrect.
Login failed.
ftp> quit
221 Goodbye.
[root@smallfry tmp]#
Now that testing is complete, you can make this a regular part of your
FTP server’s operation.



  • Hero Member
  • *****
  • Bài viết: 3980
  • Số Lần: +73/-0
Re: Install and Configure VSFTPD
« Trả lời #1 vào: Tháng Bảy 21, 2012, 01:47:03 PM »
  Tom_and_Jerry 1.gif  Tom_and_Jerry 1.gif  Tom_and_Jerry 1.gif


  • bạn
Re: Install and Configure VSFTPD
« Trả lời #2 vào: Tháng Tư 18, 2013, 11:20:00 AM »
 @nhochut @bansung @bansung @coilua

Ngủ rồi nontakjaba

  • Newbie
  • *
  • Bài viết: 36
  • Số Lần: +0/-0
Re: Install and Configure VSFTPD
« Trả lời #3 vào: Tháng Mười Hai 18, 2017, 09:01:00 PM »
Cam on ban da chia se


Related Topics

  Tiêu đề / Tác giả Trả lời Bài mới
1 Trả lời
1387 Lượt xem
Bài mới Tháng Sáu 26, 2012, 08:51:15 AM
gửi bởi CCNACCNP
6 Trả lời
3122 Lượt xem
Bài mới Tháng Ba 03, 2017, 04:16:29 AM
gửi bởi minhland2345
0 Trả lời
176 Lượt xem
Bài mới Tháng Chín 18, 2018, 04:24:54 PM
gửi bởi CCNACCNP
1 Trả lời
2024 Lượt xem
Bài mới Tháng Mười Hai 25, 2018, 01:20:25 PM
gửi bởi huyenngoc.24971
1 Trả lời
138 Lượt xem
Bài mới Tháng Một 17, 2019, 02:51:23 PM
gửi bởi CCIEInternetworkExpert