IT관련 지식들

우분투 FTP 서버 설정(공유기 사용)

동글동글82 2018. 4. 3. 13:17

1. ftp서버 설치

>> sudo apt-get install vsftpd


2. 서버 설정.


#--- inetd 모드가 아닌 독립 모드로 vsftp 실행

listen=YES

#--- FTP를 위한 Listen Port를 지정 한다.

listen_port=50021

...

# Allow anonymous FTP? (Disabled by default)

anonymous_enable=NO

...

#

# Uncomment this to allow local users to log in.

local_enable=YES

#

# Uncomment this to enable any form of FTP write command.

write_enable=YES

#

# Default umask for local users is 077. You may wish to change this to 022,

# if your users expect that (022 is used by most other ftpd's)

local_umask=777

#

# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.

anon_mkdir_write_enable=YES

#

#

# Make sure PORT transfer connections originate from port 20 (ftp-data).

#connect_from_port_20=YES

connect_from_port_20=NO

#

# You may override where the log file goes if you like. The default is shown

# below.

xferlog_file=/var/log/vsftpd.log

#


#kangmin_add

#--- 데이터 전송을 위해서 Active Mode를 사용도록 설정 한다.

#--- Active Mode에서 FTP 데이터 전송을 위한 디폴트 포트는 20 port 이다.

port_enable=YES

#--- 데이터 전송을 위해서 Passive Mode를 사용하지 못하도록 한다.

pasv_enable=YES

# // 외부 IP주소를 passive 연결에 사용.

pasv_address=XXX.XXX.XXX.XXX     


#---  20번 포트의 데이터전송 연결을 허용 한다.

connect_from_port_20=YES

#--- Active Mode에서 사용할 FTP-Data 포트를 강제로 50020 port로 변경 한다.

ftp_data_port=50020


#--- Passive Mode에서 사용할 FTP-Data 포트를 강제로

#--- 50031 port에서 50040 port까지 허용 한다.

pasv_min_port=50031

pasv_max_port=50040


3. 공유기 설정

- 포트포워딩에 포트 주소를 추가.