نحوه ویرایش تنظیمات سرور FTP از طریق خط فرمان

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

FTP ConfigurationProFTPPure-FTP

~2 دقیقه مطالعه · آخرین به‌روزرسانی ۲۹ بهمن ۱۴۰۴

1. Overview


This guide explains how to manually edit your server’s FTP configuration using the command line. These steps allow administrators to customize behavior for ProFTP or Pure-FTP depending on which service is installed.


Note: For additional configuration methods, refer to the FTP Server Configuration documentation in WHM.


2. Determine Your FTP Server


To identify which FTP server your system uses, log in via SSH as the root user and run the following command:


grep ftpserver /var/cpanel/cpanel.config

You will receive one of the following results:


  • ftpserver=proftpd
  • ftpserver=pure-ftpd

Follow the configuration instructions that match your server type.


3. ProFTP Configuration


To edit the configuration for ProFTP, follow these steps:


  1. Create or edit the /var/cpanel/conf/proftpd/local file using your preferred text editor.
  2. Add your configuration changes to the file.
  3. Apply the changes by running the following command:

/scripts/setupftpserver proftpd --force

4. ProFTP Configuration with managed_settings


The file /usr/local/cpanel/Cpanel/FtpUtils/Config/Proftpd.pm contains managed_settings options that can be configured from the command line.


You may configure:


  • Options corresponding to WHM’s FTP Server Configuration interface.
  • Options related to Network Address Translation (NAT).

To print the contents of the file, run:


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

Inside the file, the managed_settings list appears in the new subroutine. For example:


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

After making changes, apply them using:


/scripts/setupftpserver proftpd --force

5. Pure-FTP Configuration


To edit the configuration for Pure-FTP, follow these steps:


  1. Create or edit the /var/cpanel/conf/pureftpd/local file.
  2. Add your desired configuration. For example, to set the ForcePassiveIP value:

ForcePassiveIP: 203.0.113.0

To clear the value, use:


ForcePassiveIP: ~

Apply the changes with:


/scripts/setupftpserver pure-ftpd --force

6. Conclusion


Editing FTP server configuration from the command line provides full control over how ProFTP and Pure-FTP operate on your server. By modifying local configuration files and applying updates with force rebuild commands, administrators can fine-tune performance, security, and network behavior.


نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

راهنمای کامل بازیابی اکانت cPanel و انتقال حساب‌ها و تنظیمات برای مدیران سیستم تازه‌کار

این مقاله یک راهنمای جامع برای مدیران سیستم تازه‌کار است که می‌خواهند اکانت‌های cPanel را بازیابی کنند، حساب‌ها و تنظیمات را بین سرورها منتقل کنند، و از ابزارهای تشخیصی برای بررسی مشکلات انتقال و بازیابی استفاده کنند. این راهنما شامل نحوه استفاده از WHM، نحوه آپلود بکاپ‌ها، روش‌های انتقال، و فعال‌سازی لاگ‌های پیشرفته است.

ادامه

How to Move All cPanel Accounts from One Server to Another

This guide explains how to migrate all cPanel accounts, service configurations, SSL certificates, and the main server IP address from an old source server to a new target server. It covers installation requirements, configuration transfers, account migration, IP reassignment, DNS adjustments, and SSL restoration.

ادامه

آموزش کامل مهاجرت یک وب‌سایت وردپرس از macOS به سرور cPanel & WHM

این مقاله نحوه انتقال یک وب‌سایت وردپرس که روی macOS میزبانی شده است را به یک سرور cPanel & WHM توضیح می‌دهد. شامل خروجی گرفتن از دیتابیس، آپلود فایل‌ها، ایجاد دیتابیس جدید، تنظیم wp-config.php، تغییر URL سایت، و رفع لینک‌ها و تصاویر خراب است.

ادامه

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

این مقاله نحوه انتقال دستی یک اکانت بین دو سرور را زمانی که حجم اکانت برای ابزارهای انتقال WHM بسیار بزرگ است توضیح می‌دهد. شامل ایجاد دایرکتوری موقت، فشرده‌سازی public_html و لاگ‌ها، انتقال امن با scp، و بازیابی فایل‌ها در سرور جدید است.

ادامه

آموزش کامل مهاجرت دستی داده‌های Horde به Roundcube در cPanel & WHM

این مقاله نحوه مهاجرت دستی تقویم‌ها و مخاطبین Horde به Roundcube را در نسخه‌های 108 تا 118 cPanel & WHM توضیح می‌دهد. شامل مراحل خروجی گرفتن از Horde، انتقال فایل‌ها به مسیرهای صحیح، و وارد کردن داده‌ها در Roundcube با استفاده از افزونه‌های داخلی یا ابزارهای واردسازی است.

ادامه

آموزش کامل مهاجرت دستی اکانت‌ها از کنترل‌پنل‌های غیرپشتیبانی‌شده به cPanel & WHM

این مقاله نحوه مهاجرت دستی اکانت‌ها از کنترل‌پنل‌های غیرپشتیبانی‌شده به cPanel & WHM را توضیح می‌دهد. شامل اقدامات قبل از مهاجرت، نصب سرور جدید، انتقال فایل‌ها و دایرکتوری‌ها، بازیابی دیتابیس‌ها، انتقال SSL، و اقدامات پس از مهاجرت است.

ادامه