How to Edit FTP Server Configuration from the Command Line

This article explains how to manually edit FTP server configuration from the command line, determine which FTP service is running, and apply configuration changes for both ProFTP and Pure-FTP. It also covers managed_settings options and how to apply updates using force rebuild commands.

FTP ConfigurationProFTPPure-FTP

~2 min read · Updated Feb 18, 2026

1. مقدمه


این راهنما نحوه ویرایش دستی تنظیمات FTP سرور را از طریق خط فرمان توضیح می‌دهد. با استفاده از این روش، مدیران سرور می‌توانند رفتار سرویس‌های ProFTP و Pure-FTP را مطابق نیاز خود سفارشی‌سازی کنند.


نکته: برای روش‌های بیشتر پیکربندی، می‌توانید به مستندات تنظیمات سرور FTP در WHM مراجعه کنید.


2. تشخیص نوع سرور FTP


برای اینکه بدانید سرور شما از کدام سرویس FTP استفاده می‌کند، از طریق SSH با کاربر root وارد شوید و دستور زیر را اجرا کنید:


grep ftpserver /var/cpanel/cpanel.config

خروجی یکی از موارد زیر خواهد بود:


  • ftpserver=proftpd
  • ftpserver=pure-ftpd

بر اساس نوع سرویس، مراحل مربوطه را دنبال کنید.


3. تنظیمات ProFTP


برای ویرایش تنظیمات ProFTP مراحل زیر را انجام دهید:


  1. فایل /var/cpanel/conf/proftpd/local را با ویرایشگر دلخواه خود ایجاد یا ویرایش کنید.
  2. تنظیمات موردنظر خود را در این فایل وارد کنید.
  3. برای اعمال تغییرات، دستور زیر را اجرا کنید:

/scripts/setupftpserver proftpd --force

4. تنظیمات ProFTP با managed_settings


فایل /usr/local/cpanel/Cpanel/FtpUtils/Config/Proftpd.pm شامل گزینه‌های managed_settings است که می‌توان آن‌ها را از طریق خط فرمان پیکربندی کرد.


این گزینه‌ها شامل موارد زیر هستند:


  • گزینه‌هایی که در رابط تنظیمات FTP در WHM نمایش داده می‌شوند.
  • گزینه‌های مربوط به مدیریت NAT.

برای مشاهده محتوای فایل، دستور زیر را اجرا کنید:


cat /usr/local/cpanel/Cpanel/FtpUtils/Config/Proftpd.pm

در این فایل، گزینه‌های managed_settings در تابع new قرار دارند. نمونه‌ای از این بخش:


sub new {
    my $class = shift;
    my $self  = $class->SUPER::_init();
    $self->{'managed_settings'} = {
        'maxinstances' => {
            'name'    => 'MaxInstances',
            'context' => { 'server' => 2, },
            'default' => 'none',
}

پس از اعمال تغییرات، دستور زیر را اجرا کنید:


/scripts/setupftpserver proftpd --force

5. تنظیمات Pure-FTP


برای ویرایش تنظیمات Pure-FTP مراحل زیر را انجام دهید:


  1. فایل /var/cpanel/conf/pureftpd/local را ایجاد یا ویرایش کنید.
  2. تنظیمات موردنظر را وارد کنید. برای مثال، برای تنظیم مقدار ForcePassiveIP:

ForcePassiveIP: 203.0.113.0

برای حذف مقدار:


ForcePassiveIP: ~

برای اعمال تغییرات، دستور زیر را اجرا کنید:


/scripts/setupftpserver pure-ftpd --force

6. نتیجه‌گیری


ویرایش تنظیمات FTP از طریق خط فرمان امکان کنترل کامل بر رفتار سرویس‌های ProFTP و Pure-FTP را فراهم می‌کند. با ویرایش فایل‌های محلی و اجرای به‌روزرسانی اجباری، مدیران می‌توانند عملکرد، امنیت و رفتار شبکه را مطابق نیاز خود تنظیم کنند.


Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue