Solaris9 Proftp 설치(패키지)

Posted 2008. 12. 23. 18:42


현재 제가 설치하는 것을 토대로 해서 적겠습니다. (2009.01.23)

환경 : Solaris9 SPARC


일단 http://sunfreeware.com 에 가셔서 Solaris9 SPARC  -> 밑의 파일들을 다운 받으세요~!

proftpd-1.3.1-sol9-sparc-local.gz
ncurses-5.6-sol9-sparc-local.gz

다운 받은 파일들을 Server로 옮기는건 각자 알아서.... ^^;

이제 설치를 하도록 하겠습니다.

일단 압축을 풀도록 하겠습니다.  해당 파일이 있는 디렉토리에 가셔서 밑의 명령어를 쓱쓱~

# gunzip -d  proftpd-1.3.1-sol9-sparc-local.gz
# gunzip -d  ncurses-5.6-sol9-sparc-local.gz


압축을 풀었으니 패키지 설치를..

# pkgadd -d ncurses-5.6-sol9-sparc-local

다음과 같은 패키지를 사용할 수 있습니다.
  1  SMCncurs     ncurses
                  (sparc) 5.6

처리할 패키지(들)를 선택하십시오.(또는 모든 패키지를
처리하려면'all'을 입력하십시오.) (default: all) [?,??,q]: all


# pkgadd -d proftpd-1.3.1-sol9-sparc-local

다음과 같은 패키지를 사용할 수 있습니다.
  1  SMCpftpd     proftpd
                  (sparc) 1.3.1

처리할 패키지(들)를 선택하십시오.(또는 모든 패키지를
처리하려면'all'을 입력하십시오.) (default: all) [?,??,q]: all


일단 설치 도중에 에러가 발생한다면 다른 필요한 라이브러리가 설치가 되지않아 생긴 문제이니 이건 어쩔수 없이 각자 알아서.. 설치를....

다 설치되었다는 가정하에

# vi /usr/local/etc/profptd.conf

# This is a basic ProFTPD configuration file (rename it to
# '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                      "ProFTPD Default Installation"
#ServerType                     inetd
ServerType                     standalone
DefaultServer                   on

# Port 21 is the standard FTP port.
Port                            21

# 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 ~

inetd로 등록을 할려고 하였으나  Error가 발생하여 다시 standalone으로 바꾸었습니다.
만약 상위 디렉토리로 이동이 되지 않도록 할려면 #DefaultrRoot ~ 가 주석처리 되어있는걸 해제해 주세요~!

이제 inetd.conf 파일에 등록을 할 차례입니다.
이 파일은 보안문제로 읽기 전용파일(444)로 되어있으니 실행 권한을 수정(755)하셔야 합니다.

# chmod 755 /etc/inet/inetd.conf

이렇게 한다음

# vi /etc/inet/inetd.conf

# FTPD - FTP server daemon
#ftp    stream  tcp6    nowait  root    /usr/sbin/in.ftpd       in.ftpd -a
ftp     stream  tcp6    nowait  root    /usr/local/sbin/in.proftpd      in.proftpd

전 FTP 부분을 찾아 원래 사용하던 ftp 를 주석처리하고 Proftpd 부분을 추가하여 사용하도록 하였습니다.

이제 inetd 를 재시작 하겠습니다.

#ps -ef | grep inetd

    root 14383     1  0 09:55:09 ?        0:00 /usr/sbin/inetd -s

꼭~ PID를 확인

#kill -HUP 14383

이제  /etc/inet/inetd.conf  파일 권한을 755 에서 원래대로인 444로 바꾸겠습니다.

# chmod 444 /etc/inet/inetd.conf

이제 ProFTP를 실행할 차례입니다.

# /usr/local/sbin/prftpd  or
# /usr/local/sbin/in.proftpd  를 실행하시고 테스트를 해보세요~!

처음 환영글이 ProFTP로 뜨게 되면 설치가 완료.


혹시 실행은 되는데 FTP 접속이 되지 않는다면 /etc/inet/inetd.conf 여기에 추가한

ftp     stream  tcp6    nowait  root    /usr/local/sbin/in.proftpd      in.proftpd
이 라인은 주석 처리하거나 삭제해 주세요.

그다음 아시죠? inet 재시작..

#ps -ef | grep inetd

    root 14383     1  0 09:55:09 ?        0:00 /usr/sbin/inetd -s

꼭~ PID를 확인

#kill -HUP 14383


그리고 직접 올릴수 있도록 파일을 만드는 작업을 해야합니다.

# vi /etc/init.d/proftpd

case "$1" in

'start')
     # Start the ProFTP daemon
     if [ -f /usr/local/sbin/proftpd ]; then
          echo "starting ProFTP daemon"
          /usr/local/sbin/proftpd &
     fi
     ;;

'stop')
     # Stop the ProFTP deamon
     PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep proftpd | /usr/bin/awk '{print $1}'`
     if [ ! -z "$PID" ] ; then
          /usr/bin/kill ${PID} >/dev/null 2>&1
   echo "stoping ProFTP daemon"
     fi
     ;;

*)
     echo "usage: /etc/init.d/proftpd {start|stop}"
     ;;

esac
exit 0

이 내용이 적힌 파일을 첨부파일로 올리겠습니다.



# chown root:sys /etc/init.d/proftpd
profptd 파일의 소유자 및 그룹을  root:sys 로 변경

# chmod 755 /etc/init.d/proftpd
proftpd 파일의 권한을 755 (r-xr-xr-x)

# ln -s /etc/init.d/proftpd /etc/rc2.d/S99proftpd
/etc/init.d/proftpd 파일을 /etc/rc2.d/S99proftpd 파일을 만들면서 링크
그리고 /etc/rc2.d/S99proftpd 링크를 걸게 되면 Server Reboot 데몬이 자동 실행되어 가동이 됩니다.


아직 미숙한게 많아 아직도 테스트중입니다.  틀린점이 있더라도 너그럽게 용서를... ^^;