CentOS์—์„œ FTP์„œ๋ฒ„ ๊ตฌ์ถ•/๊ด€๋ฆฌํ•˜๊ธฐ (vsftpd)

๋ฐ˜์‘ํ˜•

* CentOS : ๋ ˆ๋“œํ–‡ ๋ฆฌ๋ˆ…์Šค์˜ ๋ฌด๋ฃŒ ๊ณต๊ฐœํŒ์œผ๋กœ ์œ ๋ฃŒ๋กœ ๋ผ์ด์„ผ์Šค ์ด์šฉ๋ฃŒ๋ฅผ ์ง€๋ถˆํ•ด์•ผํ•˜๋Š” RedHat Enterprise์™€ ๋‹ฌ๋ฆฌ ์ผ๋ฐ˜์ธ๋“ค์—๊ฒŒ ๋ฌด๋ฃŒ๋กœ ๋ฐฐํฌํ•˜๋Š” ๋ ˆ๋“œํ–‡ ๊ณ„์—ด ๋ฆฌ๋ˆ…์Šค ์ค‘์˜ ํ•˜๋‚˜๋‹ค. ์ฃผ๋กœ ๊ฐœ์ธ์šฉ๋ณด๋‹ค ์„œ๋ฒ„์šฉ์— ๊ฐ–์ถฐ์ ธ์žˆ์œผ๋ฉฐ GUI๋Š” Gnome 2.x ํ™˜๊ฒฝ์— ์ตœ์ ํ™”๋˜์–ด ์žˆ๋‹ค.


FTP์„œ๋ฒ„์— ๋Œ€ํ•œ ์ •์˜์— ๋Œ€ํ•˜์—ฌ ์ตœ์†Œํ•œ์˜ ์ง€์‹์„ ๋‘๊ณ  ์˜จ ๊ฒƒ์ด๋ผ ์ƒ๊ฐํ•˜์—ฌ ์ž์„ธํ•œ ์„ค๋ช…์€ ํ•˜์ง€ ์•Š๊ฒ ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ๋‹ค๋ฃฐ ๋‚ด์šฉ์€ CentOS์—์„œ vsftpd๋ผ๋Š” ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ์„ค์น˜ํ•˜์—ฌ FTP ์„œ๋ฒ„๋ฅผ ๊ตฌ์ถ•ํ•˜๊ณ , ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ๋ ค๋“œ๋ฆฌ๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.


   * vsftpd (very secure FTP daemon) : ์œ ๋‹‰์Šค/๋ฆฌ๋ˆ…์Šค ์‹œ์Šคํ…œ์—์„œ FTP ์„œ๋ฒ„ ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•œ ์ผ์ข…์˜ ํ”„๋กœ๊ทธ๋žจ


์ž ๋จผ์ € ํ„ฐ๋ฏธ๋„ ํ˜น์€ ์ฝ˜์†” ๋ชจ๋“œ๋ฅผ ๋„์šฐ๋Š”๋ฐ, root๋กœ ๋กœ๊ทธ์ธ์„ ํ•˜๋Š” ๊ฒƒ์€ ํ•„์ˆ˜๊ฒ ์ฃ ?

๋กœ๊ทธ์ธ์„ ํ•˜์…จ์œผ๋ฉด ๋นจ๊ฐ•์ƒ‰์œผ๋กœ ๋œ ๋ถ€๋ถ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”~


[root@hostname ~]# yum -y install vsftpd


์„ค์น˜๊ฐ€ ๋ชจ๋‘ ๋๋‚ฌ์œผ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์ฝ˜์†” ๋ชจ๋“œ์— ์„ค์ •์„ ํŽธ์ง‘ํ•ด๋ด…์‹œ๋‹ค.


[root@hostname ~]# vim /etc/vsftpd/vsftpd.conf


์ œ๊ฐ€ ์„ค์ •ํ•œ ๊ฒƒ์€ ์ด๋Ÿฌํ•ฉ๋‹ˆ๋‹ค~

#์€ ์ฃผ์„, #์ด ์—†๋Š” ๋ถ€๋ถ„์ด ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. (์ด ์ •๋„๋Š” ์ˆ™์ง€ํ•˜์…”์•ผํ•ฉ๋‹ˆ๋‹ค.)

์ผ๋ถ€ ์„ค์ •ํ•œ ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ ํ•œ๊ธ€ํ™” ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

# Example config file /etc/vsftpd/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. # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). --> ์ต๋ช… ๋กœ๊ทธ์ธ ๊ฑฐ๋ถ€ anonymous_enable=NO # Uncomment this to allow local users to log in. --> ๋กœ์ปฌ ๊ณ„์ • ์‚ฌ์šฉ (FTP ์„œ๋ฒ„ ๋‚ด์˜ ๋ณ„๋„ ๊ณ„์ •์ด ์•„๋‹Œ ๋ฆฌ๋ˆ…์Šค ๊ณ„์ • ์‚ฌ์šฉ) local_enable=YES # # 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) --> ํŠน์ˆ˜๊ถŒํ•œ 022 ์„ค์ • local_umask=022 # 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 --> ๋””๋ ‰ํ„ฐ๋ฆฌ ์ ‘๊ทผ๋งˆ๋‹ค ๋ฉ”์‹œ์ง€ ์—ฌ๋ถ€ ์„ค์ • # # Activate logging of uploads/downloads. xferlog_enable=YES --> ์—…๋กœ๋“œ/๋‹ค์šด๋กœ๋“œํ•  ๋•Œ๋งˆ๋‹ค ๋กœ๊ทธ ๊ธฐ๋ก ์—ฌ๋ถ€ ์„ค์ • # # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES --> ํฌํŠธ 20๋ฒˆ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ „์†ก ์—ฌ๋ถ€ ์„ค์ • # # 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 # # You may override where the log file goes if you like. The default is shown # below. xferlog_file=/var/log/vsftpd.log # # If you want, you can have your log file in standard ftpd xferlog format. # Note that the default log file location is /var/log/xferlog in this case. xferlog_std_format=YES # # You may change the default value for timing out an idle session. idle_session_timeout=0 # # You may change the default value for timing out a data connection. data_connection_timeout=0 # # 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 # # 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 # # 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=NO ascii_download_enable=NO # # You may fully customise the login banner string: #ftpd_banner=Welcome to blah FTP service. # # You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. #deny_email_enable=NO # (default follows) #banned_email_file=/etc/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 chroot_list_enable=YES # (default follows) chroot_list_file=/etc/vsftpd/chroot_list # # 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 # # 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 # Access Port settings listen_port=4444 # # 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 userlist_enable=YES tcp_wrappers=YES # Host Maximum User max_clients=5 max_per_ip=5 # Permissions file_open_mode=0664 # BANNER Messeages ftpd_banner=Welcome to My FTP Server! # Passive Mode Options # pasv_promiscuous=YES pasv_enable=YES pasv_min_port= pasv_max_port= pasv_address=hostaddress # SSL options 

ssl_enable=NO


์ œ๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ์„œ๋ฒ„๋Š” ์—ฌ๋Ÿฌ ์‚ฌ๋žŒ์ด ๊ณต์šฉ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ์„œ๋ฒ„์™€๋Š” ๊ฑฐ๋ฆฌ๊ฐ€ ๋ฉ€๊ธฐ ๋•Œ๋ฌธ์— ์„ธ๋ถ€์ ์ธ ๋ณด์•ˆ ๋ถ€๋ถ„์˜ ์„ค์ •์€ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ์œ„์— ์„ค์ •์ฒ˜๋Ÿผ ๊ธฐ๋ณธ ํฌํŠธ 21๋ฒˆ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์€ ์œ ์ €๋ถ„๋“ค ์ค‘ Explorer์—์„œ FTP ์„œ๋ฒ„๋ฅผ ์ ‘๊ทผํ•˜๊ณ ์ž ์›ํ•œ๋‹ค๋ฉด pasv_address๋ฅผ ๋ฐ˜๋“œ์‹œ ์ž๊ธฐ IP์ฃผ์†Œ๋‚˜ ๋„๋ฉ”์ธ ์ฃผ์†Œ๋กœ ์„ค์ •ํ•˜์—ฌ์•ผ ์ •์ƒ์ ์ธ ๋กœ๊ทธ์ธ์ด ๊ฐ€๋Šฅํ•˜๋ฏ€๋กœ ์ด ์  ์ฐธ๊ณ  ๋ฐ”๋ž๋‹ˆ๋‹ค.


์ž ์„ค์ •์ด ๋ชจ๋‘ ๋๋‚˜์…จ์œผ๋ฉด ์ด์ œ FTP ์„œ๋ฒ„๋ฅผ ๋Œ๋ ค์•ผ๊ฒ ์ง€์š”? 


[root@hostname ~]# service vsftpd start 


์ž ์ด์ œ ์ •์ƒ์ ์œผ๋กœ ์ ‘์†์ด๋˜๋Š”์ง€ ํ™•์ธํ•ด๋ด…์‹œ๋‹ค.

๋ฐ˜์‘ํ˜•
TAGS.

Tistory Comments