Web Server

CentOS8에서 NginX를 이용해 FTP 서버 구축

gamjadori 2024. 2. 1. 17:06
728x90

<FTP란?>

  • 네트워크를 통해 파일을 전송하기 위한 표준 프로토콜 중 하나
  • 클라이언트와 서버 간에 파일을 교환하는 데 사용되며, 주로 파일을 업로드(클라이언트에서 서버로 파일 보내기)와 다운로드(서버에서 클라이언트로 파일 받기)를 지원

<FTP 서버 설정>

1. vsftpd 서비스 설치

[root@localhost ~]# dnf search vsftpd
[root@localhost ~]# dnf install vsftpd

 

 

2. vsftpd.conf 파일 설정

  • 위치: /etx/vsftpd/

<vsftpd.conf 편집 내용>

[root@localhost ~]# vi /etc/vsftpd/vsftpd.conf

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO     [ YES → NO 변경 ]


# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
    101 chroot_local_user=YES   [# 주석 제거하거나 라인 추가]

// 맨 밑에 추가
pasv_enable=YES               [ 추가 ]
pasv_min_port=50001           [ 추가 ]
pasv_max_port=50005           [ 추가 ]
allow_writeable_chroot=YES    [ 추가 ]

 

 

3. 시스템 재시작

[root@localhost ~]# systemctl start vsftpd
[root@localhost ~]# systemctl enable vsftpd
[root@localhost ~]# systemctl status vsftpd 
>> active 상태 확인

 

 

4. 방화벽 설정

[root@localhost vsftpd]# firewall-cmd —permanet —add-service=ftp
[root@localhost vsftpd]# firewall-cmd —permanet —add-port=50001-50005/tcp
[root@localhost vsftpd]# firewall-cmd —permanet —reload
[root@localhost vsftpd]# firewall-cmd —list-all

 

<서버 설치 확인>

  • 브라우저 접속창에 ftp://centos:centos@100.100.200.40 (FTP 서버 IP 주소)