Вы находитесь на странице: 1из 2

9/25/2014 [How-To] Install FTP Server on Fedora | Boubakr Tech

http://boubakr92.wordpress.com/2013/02/27/install-ftp-server-on-fedora/ 1/2
[How-To] Install FTP Server on Fedora
Fedora, Linux February 27, 2013 Leave a comment
The FTP (File Transfer Protocol) is used as one of the most common means of copying files between servers over the
Internet, in this post we will get in touch on how to install/configure FTP on Fedora.
This tutorial can be work on the most Linux Distributions (Fedora, Debian, Ubuntu, CentOS just some
commands have to be changed).
Befora anything, make sure that your system is up to date.
Installing VSFTPD
To install VSFTPD (Very Secure FTP Daemon):
Starting the service:
Configuring VSFTPD:
VSFTPD reads the contents of its vsftpd.conf configuration file only when it starts, so youll have to restart VSFTPD
each time you edit the config file in order for the changes to take effect. The file be located in
the /etc/vsftpd directory, just edit it, each config has a comment and it explains itself
Create a user group and shared directory:
Each user want to use FTP must be in the ftp-users group
1 # yum update -y
1 # yum install -y vsftpd
1 # systemctl start vsftpd.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# vi /etc/vsftpd/vsftpd.conf
...
# Disable anonymous FTP
anonymous_enable=NO

# Enable individual logins
local_enable=YES
...
write_enable=NO
dirmessage_enable=YES
dirlist_enable=YES
...
file_open_mode=0777
ftpd_banner= Welcome to my FTP Server
...

# systemctl restart vsftpd.service
1
2
# groupadd ftp-users
# mkdir /home/ftp-docs
9/25/2014 [How-To] Install FTP Server on Fedora | Boubakr Tech
http://boubakr92.wordpress.com/2013/02/27/install-ftp-server-on-fedora/ 2/2
Make the directory accessible to the ftp-users group:
Add users, and make their default directory /home/ftp-docs:
Copy the shared files into the /home/ftp-docs directory
Change the permissions:
Make all files in the /home/ftp-docs directory to read only access by the group
Now, users should be able to log in via FTP to the server
As expected, anonymous FTP fails (you cant allow them by modifing the vsftpd.conf):
1
2
# chmod 750 /home/ftp-docs
# chown root:ftp-users /home/ftp-docs
1
2
# useradd -g ftp-users -d /home/ftp-docs user1
# passwd user1
1
2
# useradd -g ftp-users -d /home/ftp-docs user1
# passwd user1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ ftp 192.168.1.1
Connected to 192.168.1.1 (192.168.1.1).
220 Welcome to my FTP Server.
Name (192.168.1.1:boubakr): user1
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/ftp-docs"
ftp> ls -l
227 Entering Passive Mode (127,0,0,1,114,210).
150 Here comes the directory listing.
-rwxr----- 1 0 1002 0 Dec 29 16:53 file
226 Directory send OK.
ftp> quit
221 Goodbye.
$
1
2
3
4
5
6
7
8
9
10
11
$ ftp 192.168.1.1
Connected to 192.168.1.1 (192.168.1.1).
220 Welcome to my FTP Server.
Name (192.168.1.1:boubakr): anonymous
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> quit
221 Goodbye.
$

Вам также может понравиться