FTP
vsftpd
겸겸사
2016. 3. 15. 22:14
vsftpd - Very Secure FTP Daemon
ㅁ vsftpd 공식 site 설정 파일
https://security.appspot.com/vsftpd/vsftpd_conf.html
ㅁ 설치
yum -y install vsftpd
ㅁ yum으로 설치시 기본 설정파일
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
ㄴ anonymous 유저를 허용하는가? (익명사용자)
# Uncomment this to allow local users to log in.
local_enable=YES
ㄴ /etc/passwd 계정 사용 (Linux 기본계정 사용)
# Uncomment this to enable any form of FTP write command.
write_enable=YES
ㄴ
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
ㄴ umask 기본설정
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
ㄴ 익명 사용자 업로드 허용
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
ㄴ 익명 사용자 쓰기권한있을때에 디랙토리 생성가능 권한 허용여부
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
ㄴ 디렉토리에 message 파일 생성하여서 해당 디렉토리로 이동하였을때에 메시지 보여주는것 허용 여부
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
ㄴ ftp로그저장형식을 xferlog 형식으로 저장하는지 여부
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
ㄴ ftp data전송시 20 port 사용여부
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
ㄴ 익명으로 업로드된 파일에 대해서 지정된 유저로 소유권을 설정
#chown_username=whoever
ㄴ chown_user 사용자 계정 설정
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
ㄴ xferlog포멧으로 ftp log을 저장할때에 저장되는 위치
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
ㄴ ftp로그를 xferlog_std_format 으로 저장할건지에 대한 설정
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
ㄴ 세션 타임아웃 시간설정
# You may change the default value for timing out a 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
ㄴ ftp서버 구동을 root가아닌 일반 유저로 실행
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
ㄴ async abor 명령어를 사용할수 있도록 세팅, 파일전송을 취소하였을때에 취소되지 않는경우 해결할수 있는 옵션, 보안상 이유로 사용하지 않음
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
ㄴ 파일 upload시 아스키 모드로 전송할지 설정
#ascii_download_enable=YES
ㄴ 파일 download시 아스키 모드로 전송할지 설정
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
ㄴ ftp 접속시 보여주는 banner 설정
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
ㄴ vsftpd.banned_emails 에 설정된 주소를 로그인 거부 할수 있음 ex)anonymous@ 라고 설정해 놓으면 anonymous@ 사용하는 사용자는 접속불가
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
ㄴ vsftpd.banned_emails에 대한 설정
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
ㄴ 로컬사용자(Linux 기본유저)의 홈디렉토리를 chroot로 사용
#chroot_list_enable=YES
ㄴ chroot 사용여부 설정
#chroot_list_file=/etc/vsftpd/chroot_list
ㄴ chroot 관련 설정파일 위치
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
ㄴ ls -R 을하게되면 해당디렉토리의 서브 디렉토리까지 한꺼번에 확인가능, 서버부하의 이유로 보통은 허용하지 않으나, vsftp에서는 해당 옵션으로 허용여부를 설정
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
ㄴ vsftp를 inetd(슈퍼데몬관리형식) 모드가아닌 standlone(일반데몬형식)으로 사용할때 사용하는 옵션
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
ㄴ vsftpd가 pam사용시 사용하게될 이름 설정
userlist_enable=YES
ㄴ 명시된 사용자만 로그인을 허용(userlist_file)
tcp_wrappers=YES
ㄴ tcp_wrappers 적용 여부 확인 hosts.allow, hosts.deny 파일로 설정