Install and configure a FTP
Table of contents
Introduction
FTP is another such protocol, one that stands for “File Transfer Protocol”. It’s also one of the oldest protocols in use today, and is a convenient way to move files around. An FTP server offers access to a directory, with sub-directories.
Users connect to these servers with an FTP client, a piece of software that lets you download files from the server, as well as upload files to it.
Many internet users will never have any use for FTP, but if you’re building a website, it’s an essential tool.
So in this case, our goal will be to connect a client with a server and explain a bit the server configuration for an optimal file transfer.
Users connect to these servers with an FTP client, a piece of software that lets you download files from the server, as well as upload files to it.
Many internet users will never have any use for FTP, but if you’re building a website, it’s an essential tool.
So in this case, our goal will be to connect a client with a server and explain a bit the server configuration for an optimal file transfer.
FTP Client
A FTP client uses the protocol that carries the same name to connect to a FTP server to transfer files. In this scenario I'll be using Filezilla, an application used as a way to provide an UI to the protocol.
The first step to follow is adding a repository:
sudo add-apt-repository ppa:n-muench/programs-ppa
After that remember to perform an update of the computer package system:
sudo apt-get update
Finally, install the package:
sudo apt-get install filezilla
Once done it's interface will appear like this:
It is quite simple, offers a field at the top left of the screen where we write the server address and the following username, password fields.
Our client files appear at the left side of the screen while at the right side are the server ones.
With this it is much more simple to transfer that you may be expecting, so let's get into the server side.
The first step to follow is adding a repository:
sudo add-apt-repository ppa:n-muench/programs-ppa
After that remember to perform an update of the computer package system:
sudo apt-get update
Finally, install the package:
sudo apt-get install filezilla
Once done it's interface will appear like this:
It is quite simple, offers a field at the top left of the screen where we write the server address and the following username, password fields.
Our client files appear at the left side of the screen while at the right side are the server ones.
With this it is much more simple to transfer that you may be expecting, so let's get into the server side.
FTP Server
A FTP server is commonly used as a way that every user in the system has it's own directories to upload or download files without intruders.
To start with it, let's install the server-side FTP:
sudo apt-get install vsftpd
Once installed, our FTP server will be awake everytime the computer powers on.
As for configuration, server offers a wide spectrum of options, so my advise is to display them and change any personal preference:
cat /etc/vsftpd.conf | grep -v '^#'
PD. Use the char | and grep as show because it will display the conf.file without comments.
To start with it, let's install the server-side FTP:
sudo apt-get install vsftpd
Once installed, our FTP server will be awake everytime the computer powers on.
As for configuration, server offers a wide spectrum of options, so my advise is to display them and change any personal preference:
cat /etc/vsftpd.conf | grep -v '^#'
PD. Use the char | and grep as show because it will display the conf.file without comments.
Configuring a FTP Server
By default anonymous_enable is disabled, but I'll change it to YES allowing this users read-only access to a shared folder.
Once enabled, if we use Filezilla and we try anonymous user we'll see the shared-folder.
PD: Remember to create the public folder as you can see in the screenshots.
If you take a look at the final screenshot it can be seen that the public folder is read-only.
But all that comes from the default configuration of FTP server, so let's get into a more specific configuration.
What do you think? Will you use it?
Once enabled, if we use Filezilla and we try anonymous user we'll see the shared-folder.
PD: Remember to create the public folder as you can see in the screenshots.
If you take a look at the final screenshot it can be seen that the public folder is read-only.
But all that comes from the default configuration of FTP server, so let's get into a more specific configuration.
- Uncomment chroot_local_user=YES to force user to work only on his folders.
- Add allow_writeable_chroot=YES to allow local users only.
- Uncomment write_enable=YES to allow users to create files inside those folders.
Now any registered user will be able to write an upload inside his own folders.
What do you think? Will you use it?
Thank you for reading my amateur tutorial and I hope we'll keep improving together!
Comentarios
Publicar un comentario