[linux CentOS] 리눅스에서 proftpd로 FTP서버운영

Posted by 겨울에
2011. 2. 17. 09:27 scrap/ Linux
출처 : http://blog.naver.com/jongspyo?Redirect=Log&logNo=20068844998   작성자 천하무적


1. /usr/local/src/ 밑에 http://www.proftpd.org/ 사이트에서 가장 최신버전으로 다운로드
     #tar xvzf proftpd-1.3.2.tar.gz
 
2. 컴파일하기
[root@CentOS5 proftpd-1.3.2]# ./configure --prefix=/usr/local/server/proftpd \
> --enable-autoshadow \
> --enable-shadow
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files...
중략
config.status: creating Make.rules
config.status: creating config.h
config.status: executing default commands
[root@CentOS5 proftpd-1.3.2]# make
[root@CentOS5 proftpd-1.3.2]# make install
 
  나. proftpd 서버 시작스크립트 생성
/usr/local/src/proftpd-1.3.2/contrib/dist/rpm
[root@CentOS5 rpm]#cp proftpd.init.d /etc/rc.d/init.d/proftpd
proftpd.init.d : standalone서비스 즉 독립서비스를 위한 부팅시 실행파일
    xinetd : xinetd슈퍼데몬 서비스를 위한 부팅 시 실행파일
    ftp.pamd : pam인증을 사용할 때 필요한 파일
proftpd.logrotate : logrotate프로그램을 사용하여 로그를 일정기간 단위로 잘라서 보관하는 작업을 위해 필요한 파일
[root@CentOS5 rpm]#chmod 755 proftpd
[root@CentOS5 rpm]#chkconfig –add proftpd
[root@CentOS5 rpm]#chkconfig –list proftpd
proftpd         0:해제  1:해제  2:해제  3:활성  4:해제  5:해제  6:해제
proftpd.init.d파일의 내용을 살펴 보면 실행파일의 PATH 설정부분의 있다.
 
    #PATH=”$PATH:/usr/local/bin”
    이 부분을 실제 설치한 proftpd 실행파일의 경로로 수정해 주도록 한다
    PATH="$PATH:/usr/local/server/proftpd/sbin"
 
나. 환경설정 파일을 수정한다.
[root@CentOS5 etc]#vi /usr/local/server/proftpd/etc/proftpd.conf
 
다. proftpd 실행파일이 있는 /usr/local/server/proftpd/sbin 디렉토리로 가서 proftpd
    서비스 데몬을 시작한다. 데몬 시작시 그룹관련 설정에러가 보이면 proftpd 설정파일의
    30번 째줄의 그룹설정을 nobody로 설정한다.
 
[root@CentOS5 sbin]#  - Fatal: Group: Unknown group 'nogroup' on line 30 of '/usr/local/server/proftpd/etc/proftpd.conf'
 
28 # Set the user and group under which the server will run.
29 User                            nobody
30 Group                          nogroup -> nobody로 변경
 
[root@CentOS5 sbin]# service proftpd restart
Shutting down proftpd:                                     [FAILED]
Starting proftpd:  - warning: unable to determine IP address of 'hostname'
 - error: no valid servers configured
 - Fatal: error processing configuration file '/usr/local/proftpd/etc/proftpd.conf'
                                                           [FAILED]
 
proftpd.conf 제일 하단에 아래 내용 추가
 
DefaultAddress ip address
 
[root@CentOS5 bin]# ps aux | grep proftpd
nobody    1193  0.0  0.0   2600   996 ?        Ss   23:46   0:00 proftpd: (accepting connections)
root     1198  1.2  0.1   3056  1608 ?        S    23:46   0:01 proftpd: linux - 192.168.10.199: IDLE
 
* proftpd 설정 팁
 
/usr/local/server/proftpd/etc/proftpd.conf
제일 하단에 추가
#DefaultRoot ~ !wheel       -> 홈디렉토리 이하 디렉토리 접근 제한
RootLogin off                -> root계정으로 ftp접속 금지
TimesGMT off                -> ftp로그 시간 설정
SetEnv TZ :/etc/localtime
 
[CentOS] proftpd 접속시 지연현상 해결하기  CentOS  
 
#vi /usr/local/server/proftpd/etc/proftp.conf 파일의 제일 마지막 라인에 아래 내용 추가)
IdentLookups off
(사용자가 해당 ftp서버로 연결될 때 remote username을 확인하기 위해 시도)
UseReverseDNS off
(접속자의 ip주소를 도메인으로 변경하는 옵션)