Nội dung
In this tutorial, AZDIGI will help you install mod_sftp on the ProftPD on the DirectAdmin server that is using ProftPD as the main FTP server service.
I. Introduction
1. What is SFTP?
SFTP is also known by its original name: SSH File Transfer Protocol. When it comes to this protocol, listeners often think of FTP and FTPS, but this protocol is better than FTP and FTPS.
And they think it’s the same. However, in reality, SFTP uses a completely different protocol than the other two. That’s the SSH protocol – Secure Shell, a protocol used to move files. SFTP was developed in the 1990s and it allows to move files securely.
2. Advantages of SFTP
Today, SFTP has attracted a lot of people to its protocol because of these advantages:
- SFTP provides high security.
- With SFTP protocol, the access information will be encrypted and avoid hackers.
- You can increase security by combining key pair authentication with username and password.
- SFTP uses only 1 server to transfer data.
With the above advantages, it is advisable to integrate this protocol into the FTP Server service.
Prerequisites before installing mod_sftp into ProFTPD on DirectAdmin:
- Your server uses DirectAdmin.
- Your server is using ProFTPD as the FTP Server service. You can refer to the following tutorial: How to install ProftPD on DirectAdmin.
- You can access the server as
root
or any user withsudo
privileges.
II. Install mod_sftp into ProFTPD
To install mod_sftp into ProFTPD, follow these 4 steps.
Step 1: SSH into your DirectAdmin system
To install mod_sftp into ProFTPD, we first need to SSH or access your VPS/server with root privileges. Or access the server with a user with sudo
privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue to step 2 to check the Custombuild version and upgrade Custombuild if necessary before proceeding with the installation of ProFTPd on DirectAdmin.
Step 2: Check the Custombuild version
First, check if your VPS/Server is using CustomBuild 2.0 version. To check the version of CustomBuild you are using, please check out the following short tutorial:
In case your CustomBuild version is lower than 2.0 then you need to upgrade CustomBuild 1.x to 2.0 , you can check out the following tutorial:
After having CustomBuild 2.0, we continue to step 3 to execute the commands to install mod_sftp into ProFTPD.
Step 3: Commands to install mod_sftp into ProFTPD
To install mod_sftp into ProFTPD on DirectAdmin, we run the following 9 commands:
#cd /usr/local/directadmin/custombuild #./build update #./build set ftpd proftpd #mkdir -p custom/proftpd/conf #wget -O custom/proftpd/configure.proftpd http://files.directadmin.com/services/all/sftp/configure.proftpd.sftp #wget -O custom/proftpd/conf/proftpd.conf http://files.directadmin.com/services/all/sftp/proftpd.conf #chmod 755 custom/proftpd/configure.proftpd #wget -O /etc/proftpd.sftp.conf http://files.directadmin.com/services/all/sftp/proftpd.sftp.conf #./build proftpd #ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa #chmod 600 /etc/ssh/ssh_host_rsa_key #service proftpd restart
Explanation of the above commands:
- Command 1: Move into the
custombuild
directory. - Command 2: Update
custombuild scipt
. - Command 3: Set up
proftpd
as the FTP Server service. - Command 4: Initialize the
custom/proftpd/conf
directory. - Command 5: Download a separate configuration file for SFTP named
configure.proftpd.sftp
and place it in thecustom/proftpd/
directory. - Command 6: Download a separate configuration file for the ProFTPd service named
proftpd.conf
and place it in thecustom/proftpd/conf/
directory. - Command 7: Assign 755 permissions to the file
custom/proftpd/configure.proftpd
. - Command 8: Download the SFTP-specific configuration file on the ProFTPd service named
proftpd.sftp.conf
and place it in the /etc//etc/
directory. - Command 9: Install
proftpd
with the new configuration. - Command 10: Initialize a new SSH Key.
- Command 11: Assign
600
permissions to the newly created SSH Key file. - Command 12: Restart the ProFTPd service.
Below is the process:
Note: By default, when the client uses the SFTP protocol to connect to the server, it uses port 22 However, the SSHd service is also using this port by default. So if you want SFTP to use port 22, you need to change the port SSHd is using first (make sure your firewall is open on the new port), then change the value of Port 23 in the file /etc/proftpd.sftp.conf to use 22 instead, then restart ProFTPD.
But in this tutorial, I will leave the default SFTP using Port 23
.
Step 4: Check the result
You use the command to check the result on the SSH interface:
telnet localhost 21 hoặc telnet 127.0.0.1 21 telnet localhost 23 hoặc telnet 127.0.0.1 23
If your result is similar to the one below, everything works perfectly.
Alternatively, you can try using any of your FTP accounts and connect with the SFTP protocol to your server. And if you don’t want to use SFTP, you can connect as usual with port 21.
If the result is as below, then you are successful:
At this point, the installation of mod_sftp into ProFTPD on the server using DirectAdmin is complete.
III. Summary
So with the above 4 steps, you can successfully install mod_sftp into ProFTPD. If you’re using Pure-FTPd, it won’t work because Pure-FTPd doesn’t support SFTP yet.
If you’re using Pure-FTPd, it won’t work because Pure-FTPd doesn’t support SFTP yet.
If you have any problems during the implementation process, you can contact the Technical Department for assistance.
Hope this article will be of help to you. Wishing you success!
See more useful articles about DirectAdmin at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .