미니옵빠의 code stubs

Proftpd 설치 본문

OS/Linux

Proftpd 설치

미니옵빠 2014. 12. 25. 13:57

1. http://www.proftpd.org/ 에서 FTP 파일 다운로드 및 설치


2. Config 파일 수정 (etc/proftpd.conf)

대부분은 기본으로 두어도 되고, 아래 항목을 추가


# 'proftpd.conf' for actual use.  It establishes a single server

# and a single anonymous login.  It assumes that you have a user/group

# "nobody" and "ftp" for normal operation and anon.

 

ServerName                      "FTP - tod2"

ServerType                      standalone

DefaultServer                   on

ServerLog           /xxx/yyy/logs/ftp/proftp.log


UseReverseDNS off

IdentLookups  off

 

# Port 21 is the standard FTP port.

Port                            10021

 

# Don't use IPv6 support by default.

UseIPv6                         off

 

# Umask 022 is a good standard umask to prevent new dirs and files

# from being group and world writable.

Umask                           022

 

# To prevent DoS attacks, set the maximum number of child processes

# to 30.  If you need to allow more than 30 concurrent connections

# at once, simply increase this value.  Note that this ONLY works

# in standalone mode, in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd).

MaxInstances                    30

 

# Set the user and group under which the server will run.

User                            nobody

Group                           nobody

 

# To cause every FTP user to be "jailed" (chrooted) into their home

# directory, uncomment this line.

DefaultRoot ~

 

# Normally, we want files to be overwriteable.

AllowOverwrite          on

 

# Bar use of SITE CHMOD by default

<Limit SITE_CHMOD>

  DenyAll

</Limit>

 

# A basic anonymous configuration, no upload directories.  If you do not

# want anonymous users, simply delete this entire <Anonymous> section.

<Anonymous ~ftp>

  User                          ftp

  Group                         ftp

 

  # We want clients to be able to login with "anonymous" as well as "ftp"

  UserAlias                     anonymous ftp

 

  # Limit the maximum number of anonymous logins

  MaxClients                    10

 

  # We want 'welcome.msg' displayed at login, and '.message' displayed

  # in each newly chdired directory.

  DisplayLogin                  welcome.msg

  DisplayChdir                  .message

 

  # Limit WRITE everywhere in the anonymous chroot

  <Limit WRITE>

    DenyAll

  </Limit>

</Anonymous>


3. 사용자 추가

bin/ftpasswd --passwd --name=todtod80 -uid=로그인 시 권한을 부여받을 실제 사용자 계정의 UID --home=/xxx/yyy(로그인시의 홈 디렉토리) --shell=/bin/false


이렇게 하면 해당 폴더에 ftpd.passwd 파일이 생성됨

(참고: http://www.proftpd.org/docs/contrib/ftpasswd.html)


4. 사용자 설정 파일을 proftpd.conf 파일 내 추가 선언


RequireValidShell       off

AuthUserFile            /xxx/yyy/apps/proftpd/bin/ftpd.passwd

#AuthGroupFile        /xxx/yyy/apps/proftpd/bin/ftpd.group  <-- 이건 그룹까지 필요하면 설정


5. 이후 Root 권한으로 sbin/proftpd 를 실행

종료 시에는 process kill 을 이용.


참고로 proftpd 는 모두 Root 권한으로 실행된다.