-
Cenots VSFTP 설치 [ yum ]Full-Stack/Back-end 2009. 4. 22. 01:06
-> yum search vsftp
-> yum install vsftpd.i386
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vsftpd to pack into transaction set.
http://ftp.iij.ad.jp/pub/linux/centos/5.2/os/i386/CentOS/vsftpd-2.0.5-12.el5.i386.rpm: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
vsftpd-2.0.5-12.el5.i386. 100% |=========================| 17 kB 00:00
---> Package vsftpd.i386 0:2.0.5-12.el5 set to be updated
--> Running transaction checkDependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
vsftpd i386 2.0.5-12.el5 base 137 kTransaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)Total download size: 137 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): vsftpd-2.0.5-12.el 100% |=========================| 137 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: vsftpd ######################### [1/1]Installed: vsftpd.i386 0:2.0.5-12.el5
Complete!
////////////////////////////////////////////////////////////////////////////////////////
-> etc/pam.d/vsftpd 세번째 줄에 다음과 같이 있다.auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
즉, /etc/vsftpd/ftpusers 파일에 존재하는 ID는 접속할 수 없게된다.(sense=deny)
-------------------------------------------------------------
# FTP 접속을 허용하지 않을 ID를 등록한다.
# /etc/passwd를 참조해서 설치할 서버의 환경에 맞게 등록
# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
-> vi /etc/vsftpd/vsftpd.conf
# anonymous 사용자의 접속 허용 여부 (default = YES)
# 공개된 형태의 FTP 서버로 운영할 것이 아니라면 NO로 한다.
anonymous_enable=NO
# 로컬 계정 사용자의 접속 허용 여부
local_enable=YES
# write 명령어 허용 여부
write_enable=YES
# 로컬 계정 사용자용 umask (default = 077)
local_umask=022# anonymous 사용자가 파일을 업로드 할 수 있는지 여부 (default = NO)
# anon_upload_enable=YES
# anonymous 사용자의 디렉토리 생성 허용 여부 (default = NO)
# anon_mkdir_write_enable=YES# 특정 디렉토리로 들어갔을때 이 디렉토리의 설명을 보여주는 여부
dirmessage_enable=YES
# 파일 전송 로그를 남길 것인지 여부 (default = YES)
xferlog_enable=YES
# 기본적으로 사용되는 포트 : 20번포트를 사용할것을 결정한다
connect_from_port_20=YES# 익명 사용자가 등록한 파일의 소유권을 변경할지 여부
# chown_username으로 지정된 이름으로 변경됨(root로는 지정하지 말것)
#chown_uploads=YES
#chown_username=whoever
# xferlog 표준 포맷으로 로그를 남길지 여부 (기본 설정파일은 YES)
xferlog_std_format=YES# 클라이언트에서 아무런 명령이 없을경우 세션을 끝낼때까지의 대기시간
#idle_session_timeout=600# data connection을 끝을 대기 시간
#data_connection_timeout=120# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure# 비동기식 ABOR 사용 여부(보안상 비추천)
#async_abor_enable=YES# 아스키 모드 업로드/다운로드 사용여부
#ascii_upload_enable=YES
#ascii_download_enable=YES# FTP 서버 접속할 때 로긴 메시지
# 한글 사용 가능
# ftpd_banner=Welcome to blah FTP service.# 익명 접속시 패스워드에 일반 이메일 주소를 거부하는지 여부..(vsftpd.banned_emails에 지정된 이메일 주소만 허용)
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails# 접속시 최상위 디렉토리가 홈 디렉토리가 되도록 지정하는지 여부..
chroot_list_enable=YES
# /etc/vsftpd.chroot_list가 지정된 사용자는 홈 디렉토리가 최상위 디렉토리가 된다.
# 해당 파일이 없으면 500 OOPS: cannot open chroot() user list file 에러 발생시킴
chroot_list_file=/etc/vsftpd.chroot_list# 이것은 지정하게 되면 vsftpd.chroot_list의 사용자에게는 전체 디렉토리를 출력하고, 그외는 홈 디렉토리가 최상위 디렉토리가 된다.
chroot_local_user=YES# PAM 파일명을 지정 (설치할 때 /etc/pam.d/vsftpd명으로 복사함)
pam_service_name=vsftpduserlist_enable=YES
# Standalone 으로 운영할 때 listen=YES. 포트 변경을 원할 경우 listen_port 설정
# 디폴트 포트는 21번 포트이다.
# listen=YES
# listen_port=21tcp_wrappers=YES
# 전송속도 제한 (0은 제한없음, 단위는 초당 bytes)
anon_max_rate=0
local_max_rate=0
trans_chunk_size=0# 최대 접속 설정 (단 xinetd를 통하지 않고 standalone으로 동작할 때만 사용 가능)
# standalone을 위해서는 listen=YES 추가하고 별도로 vsftpd를 띄워야 함
#
# max_clients=최대 접속자 수, max_per_ip=IP당 접속 수
# max_clients=100
# max_per_ip=3
////////////////////////////////// 또 다른설정 및 설명 /////////////////////////////////////////////
실행시 에러들 ----------------------------------------------
500 OOPS: cannot change directory:/var/ftp
/var/ftp 디렉토리를 생성해 주면 된다.
550 Permission denied.
write 권한이 없는 경우 발생하는 에러이다.(write_enable=YES로 지정)
--------------------------------------------------------------500 OOPS:child died
#setsebool ftpd_disable_trans 1
#setsebool -P ftp_home_dir 1
#service vsftpd restart
#####################################
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# 익명 접속 허가 여부
anonymous_enable=YES
#
# 로컬 사용자 로그인 허가 여부(디폴트 NO)
#local_enable=YES
#
# FTP write 명령어 사용여부(주석처리되어 있으면 자료 업로드가 불가능해 진다. 디폴트 NO)
#write_enable=YES
#
# umask 지정. 디폴트는 077이다. (umask는 퍼미션에서 해당 권한을 뺀 수이다.
# 즉 022이면 디렉토리 생성시 기본 퍼미션은 755가 되는것이다.)
#local_umask=022
#
# 익명 사용자 업로드 허용여부. 허용시 업로드하실 있는 디렉토리를 생성해 주어야 한다.
#anon_upload_enable=YES
#
# 익명 사용자 새 디렉토리 생성 허가 여부
#anon_mkdir_write_enable=YES
#
# 어떤 디렉토리에 접근시 메세지를 사용자에게 보여주는지 여부
dirmessage_enable=YES
#
# 업로드/다운로드 로그 기록 여부
xferlog_enable=YES
#
# port 20 (ftp-data) 사용 여부
connect_from_port_20=YES
#
# 익명 사용자가 등록한 파일의 소유권을 변경할지 여부
# chown_username으로 지정된 이름으로 변경됨(root로는 지정하지 말것)
#chown_uploads=YES
#chown_username=whoever
#
# 로그 기록 파일의 경로
#xferlog_file=/var/log/vsftpd.log
#
# 일반적으로 사용되는 ftp의 로그 형식을 원한다면 주석 제거
#xferlog_std_format=YES
#
# 클라이언트에서 아무런 명령이 없을경우 세션을 끝낼때까지의 대기시간(디폴트 300초)
#idle_session_timeout=600
#
# data connection을 끝을 대기 시간(디폴트 60초)
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# 비동기식 ABOR 사용 여부(보안상 비추천)
#async_abor_enable=YES
#
# 아스키 모드 업로드/다운로드 사용여부
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# ftp접속시 환영 메세지
#ftpd_banner=Welcome to blah FTP service.
#
# 익명 접속시 패스워드에 일반 이메일 주소를 거부하는지 여부..(vsftpd.banned_emails에 지정된 이메일 주소만 허용)
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# 접속시 최상위 디렉토리가 홈 디렉토리가 되도록 지정하는지 여부..
#chroot_list_enable=YES
# (default follows)
#
# /etc/vsftpd.chroot_list가 지정된 사용자는 홈 디렉토리가 최상위 디렉토리가 된다.
# 해당 파일이 없으면 500 OOPS: cannot open chroot() user list file 에러 발생시킴
#chroot_list_file=/etc/vsftpd.chroot_list
#
# 이것은 지정하게 되면 vsftpd.chroot_list의 사용자에게는 전체 디렉토리를 출력하고, 그외는 홈 디렉토리가 최상위 디렉토리가 된다.
#chroot_local_user=YES
#
# 디렉토리 내용 출력시 캐쉬 사용여부..(클라언트 ftp접속 프로그램에서도 지정 가능)
#ls_recurse_enable=YESanonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
chroot_local_user=YES댓글