웹사이트 검색

Ubuntu 22.04에서 ProFTPD 및 TLS/SSL을 사용하여 FTP 서버를 설치하는 방법


ProFTPD는 Unix 및 Unix와 유사한 운영 체제용으로 작성된 무료 오픈 소스이자 기능이 풍부한 FTP 서버입니다. 이는 인터넷을 통해 파일을 업로드하고 다운로드할 수 있는 안전하고 고성능이며 고도로 구성 가능한 파일 전송 프로토콜입니다. 오픈 소스 소프트웨어이며 보안 연결을 위해 TLS(SSL)를 지원합니다.

이 튜토리얼에서는 Ubuntu 22.04에 ProFTPD FTP 서버를 설치하는 방법을 보여줍니다.

전제 조건

  • Ubuntu 22.04를 실행하는 서버.
  • 루트 비밀번호는 서버에 구성되어 있습니다.

ProFTPD 우분투 22.04 설치

기본적으로 ProFTPD 패키지는 Ubuntu 기본 저장소에 포함되어 있습니다. 다음 명령을 사용하면 쉽게 설치할 수 있습니다.

apt install proftpd -y

ProFTPD 패키지가 설치되면 다음 명령을 사용하여 ProFTPD 서비스를 시작합니다.

systemctl start proftpd

다음 명령을 사용하여 ProFTPD의 상태를 확인할 수 있습니다.

systemctl status proftpd

다음과 같은 결과가 출력됩니다.

? proftpd.service - ProFTPD FTP Server
     Loaded: loaded (/lib/systemd/system/proftpd.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-10-11 14:33:27 UTC; 16s ago
   Main PID: 5668 (proftpd)
      Tasks: 1 (limit: 2242)
     Memory: 4.4M
        CPU: 57ms
     CGroup: /system.slice/proftpd.service
             ??5668 "proftpd: (accepting connections)" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

Oct 11 14:33:26 ubuntu2204 systemd[1]: Starting ProFTPD FTP Server...
Oct 11 14:33:26 ubuntu2204 proftpd[5666]: Checking syntax of configuration file
Oct 11 14:33:27 ubuntu2204 systemd[1]: proftpd.service: Can't open PID file /run/proftpd.pid (yet?) after start: Operation not permitted
Oct 11 14:33:27 ubuntu2204 systemd[1]: Started ProFTPD FTP Server.

다음 명령을 사용하여 ProFTPD 버전을 확인할 수 있습니다.

proftpd --version

다음과 같은 결과가 출력되어야 합니다.

ProFTPD Version 1.3.7c

FTP 사용자 생성

다음으로 FTP용 사용자를 생성해야 합니다. 다음 명령을 사용하여 생성할 수 있습니다.

adduser ftpuser

아래와 같이 이 사용자의 비밀번호를 설정하십시오.

Adding user `ftpuser' ...
Adding new group `ftpuser' (1000) ...
Adding new user `ftpuser' (1000) with group `ftpuser' ...
Creating home directory `/home/ftpuser' ...
Copying files from `/etc/skel' ...
New password: 
Retype new password: 
passwd: password updated successfully
Changing the user information for ftpuser
Enter the new value, or press ENTER for the default
	Full Name []: 
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n] Y

FTP용 SSL/TLS 생성

SSL/TLS로 FTP 연결을 보호하려면 ProFTPD용 SSL/TLS를 생성해야 합니다.

먼저 다음 명령을 사용하여 OpenSSL 패키지를 설치합니다.

apt-get install openssl -y

그런 다음 다음 명령을 사용하여 SSL/TLS 인증서를 생성합니다.

openssl req -x509 -newkey rsa:1024 -keyout /etc/ssl/private/proftpd.key -out /etc/ssl/certs/proftpd.crt -nodes -days 365

아래와 같이 인증서 정보를 제공하라는 메시지가 표시됩니다.

......................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:GUJ
Locality Name (eg, city) []:JUN
Organization Name (eg, company) [Internet Widgits Pty Ltd]:IT
Organizational Unit Name (eg, section) []:ITC
Common Name (e.g. server FQDN or YOUR name) []:HITESH
Email Address []:[email 

다음으로 생성된 인증서에 적절한 권한을 설정합니다.

chmod 600 /etc/ssl/private/proftpd.key
chmod 600 /etc/ssl/certs/proftpd.crt

ProFTPD 구성

다음으로 ProFTPD 구성 파일을 편집하고 기본 설정을 변경해야 합니다.

nano /etc/proftpd/proftpd.conf

다음 구성을 변경합니다.

UseIPv6 on
ServerName "FTP Server"
Port 21
RequireValidShell on
AuthOrder mod_auth_pam.c* mod_auth_unix.c
Include /etc/proftpd/tls.conf

파일을 저장하고 닫은 후 TLS 구성 파일을 편집하고 SSL 인증서를 정의합니다.

nano /etc/proftpd/tls.conf

다음 줄을 변경하십시오.

TLSEngine                               on
TLSRSACertificateFile                   /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile                /etc/ssl/private/proftpd.key
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
TLSRequired on

파일을 저장하고 닫은 후 ProFTPD 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart proftpd

ProFTPD 서버에 접속

이 시점에서 ProFTPD 서버가 설치되고 SSL/TLS로 보호됩니다. 이제 FileZilla FTP 클라이언트를 사용하여 액세스할 차례입니다.

원격 시스템으로 이동하여 FileZilla를 엽니다. 다음 화면이 표시됩니다.

새 연결 만들기를 클릭하세요. 다음 화면이 표시됩니다.

FTP 서버 IP, 포트, 사용자 이름, 비밀번호를 입력하고 연결 버튼을 클릭하세요. FTP 연결이 설정되면 다음 화면이 표시됩니다.

결론

축하해요! ProFTPD를 성공적으로 설치하고 Ubuntu 22.04에서 SSL/TLS로 보안을 설정했습니다. 이제 보안 연결을 통해 FTP 서버에서 파일을 쉽게 업로드하고 다운로드할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.

관련기사: