질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

vsftp에서 anonymous를 이용해 파일서버 운영

작성자 정보

  • 이윤석 작성
  • 작성일

컨텐츠 정보

본문

전양선 님의 글



사무실에서 vsftp를 이용하여 파일서버를 운영하고 있습니다..

각 사용자별로 계정을 부여해서 쓸수 있도록 하였는데

이제는 공통으로 암호없이 회사양식이나..공통적으로 쓰는 서류는 암호없이 접근하여

파일을 다운로드도 하고 올려진 파일을 수정및 업데이트를 할려고 합니다.

그런데 계정없이 anonymous로 접근은 가능하나 쓰기및 수정이 안됩니다.

(쓰기는 /var/pub 의 퍼미션을 바꿔줌 원래는 쓰기도 안되었슴)

그래서 /etc/vsftpd/vsftp.conf를 수정하였는데도 수정이나 Overwrite가 안됨니다..

원래 안되는 것인지 아님.... 다른 방법이 있는지요..


-시나리오-

 현재 vsftpd를 설치했습니다. 익명접속시 딜렉토리는 /var/ftp이며, anonymous로 접속하여 다운로드가 가능합니다. 단, 업로드, 쓰기는 불가능합니다. 이것을, 업로드, 쓰기도 가능하다록 하려고 합니다.  물론, 딜렉토리 생성삭제도 가능하게요.

1. 먼저, vsftp 서비스를 중지 시키기 위해, /etc/xinetd.d/vsftpd 내용 중 disable = yes 시켰습니다. vsftpd를 제거하지 않은 이유는, 만약을 위해, 원복이 가능하도록 하기 위해서였습니다. 소심하다보니...^^;  vsftpd는 소스로 설치했었습니다.

2. proftpd-1.2.10 버전의 소스를 받아 /usr/local/proftpd 에 설치했습니다. configure시,

# ./configure --prefix/usr/local/proftpd --enable-autoshadow

# make

#make install

주의하실 점은, enable과 autoshadow 사이는 =가 아니라 -입니다.

3. /usr/local/proftpd/etc/proftp.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   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 ~

# Normally, we want files to be overwriteable.
AllowOverwrite  on

# Bar use of SITE CHMOD by default

  DenyAll

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire section.

  User    ftp
  Group    ftp

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

 
    AllowAll
 

  # 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
  DisplayFirstChdir  .message

  # Limit WRITE everywhere in the anonymous chroot
 
    AllowAll
 

 
    AllowStoreRestart on
    AllowRetrieveRestart on
    Umask 070

 
    AllowAll
 

 
    AllowAll
 

 


------------------------------------------------------------------------------------------------------------------------------------------------------------

4. /var/ftp 딜렉토리부터 하위딜렉토리까지, 모든 딜렉토리와 파일의 소유권을 ftp로 바꿉니다.

# chown -R ftp.ftp *

5. ftp 딜렉토리 안의 모든 딜렉토리와 파일에 대한 소유권도 ftp에게 -rwxrwxr-x(775)로 주었습니다.

6. 테스트 결과, 의도한대로 잘~~돌아갑니다. ㅠ_ㅠ

6. 재부팅시 자동으로 proftpd 데몬을 띄워주도록, /etc/rc.local 파일에 " /usr/local/proftpd/sbin/proftpd start " 문구를 삽입했습니다.

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,138 명
  • 현재 강좌수 :  36,196 개
  • 현재 접속자 :  549 명