본문 바로가기

리눅스 CentOS7에 vsFTP설치 및 방화벽(firewall) 관리하기

728x90
반응형

웹서버 설정 후에 원격에서 파일을 업로드 하기 위해서 FTP를 많이 사용하는데 자주 사용하는 프로그램이 vsftpd다. 서버에 이 ftp 프로그램을 설치하고 21번 포트를 열어주어야 한다.

○ vsftp 설치하기
]# yum -y install vsftpd ftp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * epel: mirror.premi.st
 * extras: ftp.neowiz.com
 * updates: ftp.neowiz.com
 * webtatic: sp.repo.webtatic.com
base                                                                                         | 3.6 kB  00:00:00     
extras                                                                                       | 3.4 kB  00:00:00     
updates                                                                                      | 3.4 kB  00:00:00     
Package ftp-0.17-67.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-22.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved

================================================
 Package                   Arch                      Version                          Repository               Size
================================================
Installing:
 vsftpd                    x86_64                    3.0.2-22.el7                     base                    169 k
Transaction Summary
================================================
Install  1 Package

Total download size: 169 k
Installed size: 348 k
Downloading packages:
vsftpd-3.0.2-22.el7.x86_64.rpm                                                               | 169 kB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : vsftpd-3.0.2-22.el7.x86_64                                                                       1/1 
  Verifying  : vsftpd-3.0.2-22.el7.x86_64                                                                       1/1 
Installed:

 vsftpd.x86_64 0:3.0.2-22.el7                                                                                      

Complete!

○ ftp 데몬 실행하기

]# service vsftpd start

Redirecting to /bin/systemctl start vsftpd.service

○ 리부팅 시 자동 실행하도록 설정

]# chkconfig --level 2345 vsftpd on

: 'systemctl enable vsftpd.service'
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.

 

 

 

 

○ 방화벽 포트 열어주기

]# firewall-cmd --add-service=ftp

success

이 명령을 이용해 ftp 포트를 열어 줄 수 있다.

 

]# firewall-cmd --add-port=21/tcp

success

ftp가 사용하는 21번 포트를 이런 방법으로 열어도 된다.

 

]# firewall-cmd --add-port=443/tcp

success

443은 https로 접근해야 하는 보안서버 포트라서 열어 두어야 한다.

 

○ 열린 포트 확인하기

]# firewall-cmd --list-all

public (active)

  target: default

  icmp-block-inversion: no

  interfaces: eth0 eth1

  sources: 

  services: dhcpv6-client ssh http https ftp

  ports: 80/tcp 21/tcp 443/tcp

  protocols: 

  masquerade: no

  forward-ports: 

  source-ports: 

  icmp-blocks: 

  rich rules: 



출처: https://ziumb.tistory.com/108 [지음빌더]

728x90
반응형