웹사이트 검색

Ubuntu 18.04 LTS에서 TLS와 함께 ProFTPD를 설치하는 방법


이 페이지에서

  1. 요구 사항\n
  2. 시작하기\n
  3. ProFTPD 설치
  4. TLS로 안전한 ProFTPD\n
  5. SSL을 사용하도록 ProFTPD 구성\n
  6. ProFTPD용 사용자 만들기
  7. FileZilla를 사용하여 ProFTPD 서버에 액세스\n

ProFTPD는 유닉스 계열 운영 체제에서 가장 많이 사용되는 무료 오픈 소스 FTP 서버입니다. ProFTPD를 사용하면 로컬 컴퓨터와 원격 서버 간에 FTP 연결을 만들 수 있습니다. 안전한 연결을 위해 TLS(SSL)를 지원하는 다목적 FTP 서버입니다.

특징

  • IPv4 및 IPv6를 지원합니다.\n
  • 디렉토리당 보안을 위해 .ftpaccess를 지원합니다.\n
  • 여러 가상 FTP 서버와 익명 FTP 서비스를 구성할 수 있습니다.\n
  • 섀도우 암호, utmp/wtmp, SSL/TLS 암호화 및 RADIUS에 대한 지원을 제공합니다.\n
  • 독립형 서버 또는 inetd/xinetd에서 실행할 수 있습니다.\n

이 튜토리얼에서는 Ubuntu 18.04 서버에서 ProFTPD를 설치하고 TLS로 보호하는 방법을 배웁니다.

요구 사항

  • Ubuntu 18.04를 실행하는 서버.\n
  • 고정 IP 주소 192.168.0.101이 서버에 설정되어 있습니다.
  • 서버에 루트 암호가 설정되어 있습니다.\n

시작하기

시작하기 전에 시스템을 최신 버전으로 업데이트해야 합니다. 다음 명령을 실행하여 이를 수행할 수 있습니다.

apt-get update -y
apt-get upgrade -y

서버가 업데이트되면 서버를 다시 시작하여 변경 사항을 적용하십시오.

ProFTPD 설치

기본적으로 ProFTPD는 Ubuntu 18.04 기본 리포지토리에서 사용할 수 있습니다. 다음 명령을 실행하여 설치할 수 있습니다.

apt-get install proftpd -y

ProFTPD를 설치한 후 ProFTPD 서비스를 시작하고 다음 명령을 사용하여 부팅 시 시작되도록 활성화합니다.

systemctl start proftpd
systemctl enable proftpd

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

systemctl status proftpd

다음 출력이 표시되어야 합니다.

? proftpd.service - LSB: Starts ProFTPD daemon
   Loaded: loaded (/etc/init.d/proftpd; generated)
   Active: active (running) since Sat 2019-05-25 09:18:19 UTC; 31s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 1 (limit: 1114)
   CGroup: /system.slice/proftpd.service
           ??1927 proftpd: (accepting connections)

May 25 09:18:19 ubuntu1804 systemd[1]: Starting LSB: Starts ProFTPD daemon...
May 25 09:18:19 ubuntu1804 proftpd[1906]:  * Starting ftp server proftpd
May 25 09:18:19 ubuntu1804 proftpd[1906]:    ...done.
May 25 09:18:19 ubuntu1804 systemd[1]: Started LSB: Starts ProFTPD daemon.

ProFTPD의 기본 구성 파일은 /etc/proftpd/proftpd.conf에 있습니다. 다음 명령으로 볼 수 있습니다.

cat /etc/proftpd/proftpd.conf

다음 출력이 표시되어야 합니다.

#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
# 

# Includes DSO modules

Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6                         on
# If set on you can experience a longer connection delay in many cases.
IdentLookups                    off

ServerName                      "Debian"
# Set to inetd only if you would run proftpd by inetd/xinetd.
# Read README.Debian for more information on proper configuration.
ServerType                              standalone
DeferWelcome                    off

MultilineRFC2228                on
DefaultServer                   on
ShowSymlinks                    on

TimeoutNoTransfer               600
TimeoutStalled                  600
TimeoutIdle                     1200

DisplayLogin                    welcome.msg
DisplayChdir                    .message true
ListOptions                     "-l"

DenyFilter                      \*.*/

# Use this to jail all users in their homes 
# DefaultRoot                   ~
# Port 21 is the standard FTP port.
Port                            21
MaxInstances                    30
# Set the user and group that the server normally runs at.
User                            proftpd
Group                           nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask                           022  022
# Normally, we want files to be overwriteable.
AllowOverwrite                  on
TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

아래와 같이 요구 사항에 따라 위의 설정을 변경할 수 있습니다.

  • ServerName: 기본 서버 이름으로 변경할 수 있습니다.\n
  • UseIPV6: 끄기로 변경하여 비활성화할 수 있습니다.\n
  • DefaultRoot: 이 줄의 주석을 제거하여 사용자의 홈 폴더를 제한할 수 있습니다.\n
  • 포트: 자신의 포트를 변경하여 정의할 수 있습니다.\n
  • SystemLog: 로그 파일의 기본 위치입니다. 요구 사항에 따라 변경할 수 있습니다.\n

완료되면 다음 단계로 진행할 수 있습니다.

TLS로 안전한 ProFTPD

이제 ProFTPD가 설치되었습니다. 이제 안전한 FTP 연결을 위해 TLS로 ProFTPD를 구성해야 합니다.

시작하기 전에 서버에 OpenSSL을 설치해야 합니다. 다음 명령을 실행하여 설치할 수 있습니다.

apt-get install openssl -y

설치가 완료되면 다음 명령을 사용하여 ProFTPd용 SSL 인증서를 생성합니다.

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

아래와 같이 모든 질문에 답하십시오.

Generating a 1024 bit RSA private key
.++++++
.......................++++++
writing new private key to '/etc/ssl/private/proftpd.key'
-----
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) []:Junagadh
Organization Name (eg, company) [Internet Widgits Pty Ltd]:IT
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:HITESH
Email Address []:

위의 명령은 두 개의 파일 /etc/ssl/private/proftpd.key 및 /etc/ssl/certs/proftpd.crt를 생성합니다.

그런 다음 다음 명령을 사용하여 생성된 파일에 적절한 권한을 제공합니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

SSL을 사용하도록 ProFTPD 구성

다음으로 SSL 인증서를 사용하도록 ProFTPD를 구성해야 합니다. /etc/proftpd/proftpd.conf 파일을 편집하여 이를 수행할 수 있습니다.

nano /etc/proftpd/proftpd.conf

다음 줄의 주석 처리를 제거하십시오.

Include /etc/proftpd/tls.conf

완료되면 파일을 저장하고 닫습니다. 그런 다음 /etc/proftpd/tls.conf 파일을 엽니다.

nano /etc/proftpd/tls.conf

다음 줄을 변경합니다.

TLSRSACertificateFile /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile /etc/ssl/private/proftpd.key
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
TLSRequired on
TLSOptions NoCertRequest EnableDiags NoSessionReuseRequired
TLSVerifyClient off

완료되면 파일을 저장하고 닫습니다. 그런 다음 다음 명령을 사용하여 ProFTPD 서비스를 다시 시작합니다.

systemctl restart proftpd

완료되면 다음 단계로 진행할 수 있습니다.

ProFTPD용 사용자 생성

다음으로 서버에 액세스하려면 ProFTPD 사용자를 생성해야 합니다. 다음 명령으로 수행할 수 있습니다.

adduser ftp1

아래와 같이 모든 질문에 답하십시오.

Adding user `ftp1' ...
Adding new group `ftp1' (1006) ...
Adding new user `ftp1' (1002) with group `ftp1' ...
Creating home directory `/home/ftp1' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for ftp1
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

완료되면 다음 단계로 진행할 수 있습니다.

FileZilla를 사용하여 ProFTPD 서버에 액세스

이제 ProFTPD가 설치 및 구성되었으며 클라이언트 시스템에서 FileZilla를 통해 ProFTPD에 액세스할 시간입니다.

먼저 클라이언트 시스템에 FileZilla를 설치해야 합니다. 다음 명령을 실행하여 설치할 수 있습니다.

apt-get install filezilla -y

설치가 완료되면 아래와 같이 Unity 대시에서 FileZilla를 열 수 있습니다.

이제 왼쪽 패널에서 사이트 관리자를 클릭하고 새 사이트를 만듭니다. 다음 페이지가 표시됩니다.

이제 FTP 서버 IP 주소를 제공하고, 프로토콜을 선택하고, 암호화를 선택하고, 로그온 유형을 선택하고, 사용자 이름과 비밀번호를 제공하십시오. 그런 다음 연결 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

이제 인증서를 수락하고 "향후 세션에서 항상 인증서 신뢰"를 선택하고 확인 버튼을 클릭합니다. 로그인에 성공하면 다음 페이지가 표시됩니다.

이제 SSL/TLS를 통해 안전하게 파일을 전송할 수 있습니다.

축하합니다! ProFTPD 서버를 성공적으로 설치 및 구성하고 SSL/TLS 암호화로 보호했습니다. 이제 안전한 암호화를 통해 파일을 로컬 컴퓨터에서 FTP 서버로 쉽게 전송할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.