Red4u.ru

SEO Сервисы и программы
12 просмотров
Рейтинг статьи
1 звезда2 звезды3 звезды4 звезды5 звезд
Загрузка...

How to set up an FTP server on Debian 10 Buster

How to set up an FTP server on Debian 10 Buster?

An FTP server, although for many it can be a bit old-fashioned, is quite useful. Especially in computer networks where you need to share files internally. Or even if we are in a house with several computers, it would also be useful. Best of all, it is still easy to set up one and more on Debian 10. So in this post, you will learn how to set up an FTP server on Debian 10. For that, we will use VSFTPD as the FTP daemon.

Install and configure FTP server on Linux Mint 20

Note: We have explained the procedure and commands on Linux Mint 20 OS. More or less the same procedure can be followed in older Mint versions.

Installing FTP server

To install an FTP server on Linux Mint, follow the below steps:

Step 1: Install VSFTPD

Our first step will be to install VFTPD on our system. To do so, launch the Terminal in Mint OS by using the Ctrl+Alt+T keyboard shortcut. Then issue the following command in the Terminal to update the system repository index:

Then install VSFTPD using the following command in Terminal:

After the installation of VSFTPD is completed, we will move towards configuration.

Step 2: Configure VSFTPD

The VSFTPD can be configured through the /etc/vsftpd.conf file. Edit the /etc/vsftpd.conf file using the following command in Terminal:

Now add or uncomment the following lines (if already added in the file):

Once done, save and close the /etc/vsftpd.conf file.

Step 3: Allow ports in firewall

If a firewall is running on your system, you will need to allow some FTP ports through it. Issue the following commands in Terminal to allow the ports 20 and 21:

You can verify whether the port has been allowed in the firewall or not using the following command in Terminal:

Читайте так же:
Как убрать рекламу в Мозиле

Step 4: Enable and run VSFTPD

Now the VSFTPD is configured and allowed in the firewall; now we can enable and run the VSFTPD services. Here are the commands to do so:

To enable the VSFTPD service to start on boot, issue the following command in Terminal:

To run the VSFTPD service, issue the following command in Terminal:

If you need to restart the VSFTPD service after making any configuration changes, issue the following command in Terminal:

To verify if the VSFTPD is active and running, issue the following command in Terminal:

Step 5: Create an FTP user

Next, create a user account that will be used to test the FTP connection. Issue the following commands in Terminal to create a user account and set a password:

Step 6: Test FTP connection

Now our FTP server is ready, so it’s time to test the FTP connection.

To test FTP connection locally, issue the following command in Terminal by replacing the <ip-address> by the actual IP address of your FTP server:

You can also test the FTP connection remotely by using the same above command from the remote system. I have tested the FTP connection from the Windows machine on the network.

You can also use the FTP client like Filezilla to connect to the FTP server. To use the Filezilla application for connecting to the FTP server, provide the IP address of FTP server, username and password that you have set earlier, and port number 21 and then click the Quickconnect button.

Once connected, you will be successfully signed in to the FTP server and will be able to access remote server files and folders.

There you have the installation and configuration of the FTP server on the Linux Mint 20 system. By following the above described simple steps, you can easily setup the FTP server and transfer files through it.

Читайте так же:
Удаление скачанных карт в Яндекс.Картах

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

Related Posts

sftp Command Examples

Install Anonymous FTP in Fedora

Install Secure FTP Using SSL on RHEL 8

Linux Commandline FTP Clients

Change FTP Port in Linux

How to Upload or Download Directory using sFTP

12 thoughts on “How to Install and Configure FTP Server in Ubuntu”

Thanks for your help!

I was wondering if it is possible to make the local_root folder on an external drive?

I tried «local_root/media///» but I kept getting the error “ cannot change directory /media/// “.

Is it because I need to give the FTP user permission somehow?

Hello. First, thank you for so big tutorial, but I have some problems with it. I am using raspberry pi 4 with working with the ubuntu server.

Updating and upgrading were successful.
Installation too.
But I can’t “start” it.

After command sudo systemctl start vsftpd and s udo systemctl enable vsftpd all was good.

Then I checked the status with command sudo service vsftpd status and the FTP server is failed. Here is information about it:

● vsftpd.service — vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-01-03 13:15:21 UTC; 27s ago
Main PID: 3012 (code=exited, status=2)

Jan 03 13:15:21 ubuntu systemd[1]: Starting vsftpd FTP server.
Jan 03 13:15:21 ubuntu systemd[1]: Started vsftpd FTP server.
Jan 03 13:15:21 ubuntu systemd[1]: vsftpd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 03 13:15:21 ubuntu systemd[1]: vsftpd.service: Failed with result ‘exit-code’.

I checked again with – sudo ufw status
Here is the result – Status: inactive

I can’t understand what can be wrong.
Maybe you can help.

Check your /etc/vsftpd.conf configuration file for any invalid arguments.

I had the same issue. There was a weird whitespace character at the end of “ userlist_deny=NO “. It worked after I removed the whitespace.

Do I have to create a file named vsftpd.userlist or does it come as part of vsftpd.config?

You can create it if it doesn’t exist.

Читайте так же:
Форматирование флешки через командную строку

Stellar! Great work and thanks for the service you provide.

Thanks for the kind words of appreciation and encouragement.

I followed your instructions but ended up being unable to write files to the server, even though I could create directories –
https://askubuntu.com/questions/995460/vsftpd-config-can-create-directories-but-cannot-create-files

Ensure that you have the correct permissions(rwx) set on the directories your created.

My FTP configuration is similar to this tutorial but still i am stuck down with below message. I am using Kali Linux as server and Ubuntu as client.

Note that here, we used Ubuntu as the server.

Consider using passive ports in the config file, open the port range say 40000-50000 in the firewall like so:
sudo ufw allow 40000:50000/tcp

And add the options below in the config file:
pasv_min_port=40000
pasv_max_port=50000

Save the file and restart the vsftpd services:
sudo systemctl restart vsftpd

Do write back in case it fails to work.

Got something to say? Join the discussion. Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Настройка защищенного (Secure) FTP.

Для защиты трафика рекомендуется использовать SSL-сертификаты. Можно использовать самоподписанные сертификаты либо выданные центром сертификации. Обратите внимание, что при подключении к серверу с самоподписанным сертификатом пользователь будет уведомлен об этом.

Создадим самоподписанный сертификат.

1. Запускаем Диспетчер служб IIS (см. выше Настройку сервера).

2. В открывшемся окне, в левой части, разворачиваем ветку под необходимым сервером. Выбираем Сертификаты сервера.

3. В новом окне, в правой части, выбираем Создать самозаверенный сертификат.

4. В открывшемся окне указываем имя сертификата и его тип — Личный. Кликаем Ок.

Сертификат создан. Теперь перейдем к настройке защищенного FTP.

1. В окне Диспетчер служб IIS, в левой части, разворачиваем ветку под необходимым сервером, выбираем созданный сервер. В основной части окна выбираем Параметры SSL FTP.

2. В обновленном окне, в выпадающем списке, выбираем созданный сертификат, либо выданный центром сертификации, если такой имеется. Выбираем Требовать SSL-соединения. В правой части окна выбираем Применить. Закрываем окно, если необходимо.

Читайте так же:
Как убрать рекламу в Мозиле

Для подключения к защищенному FTP-серверу рекомендуем использовать программу WinSCP.

Подключитесь к профилю FTP, созданному в проводнике Windows.

Здесь нам нужно дважды щелкнуть имя нашего сетевого местоположения. REDESZONE FTP , и появится такой экран:

Как и в разделе для создания FTP-соединения, мы помещаем пользователя RESIDENT и он появится, потому что он автоматически сохраняет его. Затем пришло время ввести пароль, который мы назначаем в маршрутизаторе этому пользователю. Мы также можем нажать на » Сохранить пароль », Если мы не хотим вводить его снова, если этого требуют обстоятельства безопасности.

После этого все, что нам нужно сделать, это нажать на кнопку » Начать сессию »И вы увидите что-то похожее на это:

Папка FRITZ и REDESZONE — это две папки, которые находятся внутри FTP-сервера, к которому мы подключились, FRITZ относится к внутренней памяти маршрутизатора, а REDESZONE — это USB-накопитель, который мы подключили к маршрутизатору через порт USB 3.0.

Как вы видели, очень легко создать профиль FTP в Windows 10 и подключиться к нему, это действительно как для FTP-серверов, которые у нас есть в нашей сети (локальный FTP), так и для FTP-серверов, которые у нас есть в Интернет (пульты FTP). В обоих случаях конфигурация точно такая же, единственное, что мы можем поместить URL-адрес домена ftp: // IP или ftp: // для удаленного доступа через доменное имя, а не общедоступный IP-адрес.

Основные функции FTP

Передача данных

В процесс работы применяется управление с использованием стандартных UNIX-команд. Вспомогательные программы и отдельные команды обеспечивают загрузку файлов на сервера и их выгрузку на компьютер пользователя. Полный их перечень можно легко найти в сети.

Среди наиболее распространенных команд протокола выделяют:

  • user – применяется для передачи имени пользователя и пароля при аутентификации;
  • bye (quit) – при подаче этой команды завершаются программы и закрываются связи;
  • open – формирует связь с сайтом или серверам, предварительно должна быть закрыта предыдущая связь специальной командой close;
  • remotehelp – открывает сервисную и справочную информацию с конкретного сервера.
Читайте так же:
Удаление скачанных карт в Яндекс.Картах

Мониторинг

Регулярность резервного копирования

Если Вы пользуетесь мессенджером Telergam, у нас для Вас есть утилита мониторинга резервного копирования. Она умеет сканировать папки сетевого хранилища и сообщать о наличии или отсутствии новых файлов. Например, если резервное копирование запланировано на ночь, а утром в сетевом хранилище нет новых файлов, значит что-то пошло не так и нужно с этим разобраться.

Утилита написана на Python, сам Python в Ubuntu установлен по-умолчанию, нужно установить дополнительный модуль.

Сама утилита устанавливается из репозитория GitHib

Создайте для себя нового Telegram бота. Подробная инструкция как это сделать приведена тут (англ).

Свяжитесь с Отцом Ботов, отправьте ему сначала команду /start , затем /newbot . Далее отвечайте на вопросы Отца Ботов, в итоге Вы получите от него токен и ссылку на Вашего бота.

Открываем конфигурационный файл

Первый запуск нужен для того, что бы автоматически определить ID абонента Telegram, который будет получать сообщения (это не номер его телефона). Подключайтесь к своему боту по ссылке, которую Вам дал Отец Ботов и отправляйте ему команду /start . В ответ Вы получите сообщение, что Ваш ID определен, а утилита самонастроится и закроется. Запустите ее повторно для выполнения сканирования.

После настройки и проверки работы утилиты, добавьте ее в расписание демона cron

Проверка будет запускаться каждый день в 8 утра. Если ночью что-то пошло не так, Вы узнаете об этом.

Системные ресурсы

Мониторить ресурсы сервера можно консольной утилитой top или ее более красочной версией htop . Установим и запустим ее

Периодически контролируйте использование оперативной памяти. Если часто наблюдается загруженность около 100%, настройте файл подкачки.

Здесь count=1024 — размер файла подкачки в мегабайтах.

Дисковое пространство

Для мониторинга файловой системы удобно пользоваться файловым менеджером Midnight Commander. Если Вы застали времена MS DOS и Notron Commander, то объяснять ничего не нужно.

Устанавливаем и запускаем

Так удобно наблюдать за файловым хранилищем, карантином, свободным дисковым пространством.

голоса
Рейтинг статьи
Ссылка на основную публикацию
Adblock
detector