본문 바로가기

데이터 분석/Linux

Linux Shell Commands : FTP & Tomcat

[ Step 1: FTP 설치여부 확인 ]

  • ]# rpm -qa vsftpd*

 

[ Step 2: FTP 설치 ]

  •  ]# yum -y install vsftpd

 

[ Step 3: FTP 설치여부 재확인 ]

  • ]# yum -y install vsftpd

 

[ Step 4: vsftpd.conf 파일 수정 ]

  • ]# vi/etc/vsftpd/vsftpd.conf

  • ]# vi/etc/vsftpd/chroot_list ← 사용자 등록 (root / test)

더보기

#익명계정 접속허용여부
anonymous_enable=NO 

# 로컬계정 사용자의 접속허용여부
local_enable=YES
 
# 쓰기(upload) 허용여부
write_enable=YES
local_umask=022
dirmessage_enable=YES
 
# 파일전송 결과 로깅 여부
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES


# 주석해제
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

 

[ Step 5: FTP 상태 확인 ]

  • ]# systemctl status vsftpd.service  :  vsftpd 상태확인

  • ]# systemctl start vsftpd.service  : vsftpd 시작

  • ]# systemctl stop vsftpd.service  : vsftpd 중지

  • ]# systemctl restart vsftpd.service : vsftpd 재시작

 

[ Step 6: 서버 재가동 時 vsftpd 자동 실행등록 ]

  • ]# systemctl enable vsftpd.service

 

[ Step 7: 방화벽 중지 ]

  • ]# systemctl status firewalld.service : firewalld 실행 상태 확인 

  • ]# systemctl stop firewalld.service : firewalld 중지

  • ]# systemctl start firewalld.service : firewalld 실행 

 

[ Step 8: Port 열기, FTP의 Port = 21 ]

  • ]# firewall-cmd --list-ports : 허용한 포트 목록 보기

  • ]#   firewall-cmd --permanent --add-port=21/tcp : 포트 열기

  • ]#   firewall-cmd --permanent --zone=public --add-service=ftp

  • ]# firewall-cmd --reload :  방화벽 재실행 

 

[ Step 9: 업로드 실패 時 ]

  • ]# setsebool -P allow_ftpd_full_access on

  • ]# setsebool -P ftp_home_dir on

 

[ Step 10: Apache Tomcat 실행 작업]

  • 파일질라로 windows에 있는 Tomcat 파일 전송
  • Putty로 실행권한 수정
  • Port 열기