fedora14 64bit 를 깔았다.

컴퓨터 업글하고 남은 부품 긁어모아서 가지고 놀 목적으로 서버를 만들려고 한다.


매번 서버를 사용할때마다 모니터 연결하고 키보드 마우스 연결하고 하면 번거로우므로


ssh랑 ftp 만 설정해 놓고 네트웍만 연결 되어있으면 ssh 접속으로 다 해결 가능하므로


ssh, ftp 설정을 먼저 해주자.


ssh 는 예전 포스트에서 다루었으므로 여기서는 ftp 설치, 설정 하기!!








예전에는 rpm 패키지를 이용하거나 make, install (맞나?) 따위로 다소 복잡하게 설치를 해야했으나...


요즘엔 yum 을 이용해서 한큐에 설치가 가능한듯하다.. (세상이 편해지고있어!!)




1. 일단 vsftp 가 깔려있는지 확인


[root@localhost /]# rpm -qa | grep vsftpd



2. yum 명령을 통해 vsftp 를 설치


[root@localhost /]# yum install vsftpd
Loaded plugins: langpacks, presto, refresh-packagekit
Adding ko_KR to language list
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.3.4-1.fc14 set to be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                      Arch                         Version                              Repository                     Size
====================================================================================================================================
Installing:
 vsftpd                       x86_64                       2.3.4-1.fc14                         updates                       151 k

Transaction Summary
====================================================================================================================================
Install       1 Package(s)

Total download size: 151 k
Installed size: 336 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta                                                                                          | 982 kB     00:02    
Processing delta metadata
Package(s) data still to download: 151 k
vsftpd-2.3.4-1.fc14.x86_64.rpm                                                                               | 151 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : vsftpd-2.3.4-1.fc14.x86_64                                                                                   1/1

Installed:
  vsftpd.x86_64 0:2.3.4-1.fc14                                                                                                      

Complete!
[root@localhost /]#




3. 설치 되었는지 확인 (1 의 내용)

[root@localhost /]# rpm -qa | grep vsftpd
vsftpd-2.3.4-1.fc14.x86_64
[root@localhost /]#



4. vsftp 상태확인

[root@localhost /]# /etc/init.d/vsftpd status
vsftpd가 정지되었습니다
[root@localhost /]#



5. vsftp 설정을 하여준다.
설정파일은 /etc/vsftpd/vsftpd.conf 파일임

[root@localhost vsftpd]# pwd
/etc/vsftpd
[root@localhost vsftpd]# ls
ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
[root@localhost vsftpd]# vi 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=YES
#
# Uncomment this to allow local users to log in.
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)
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
#
# 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=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
#
# 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=YES
#ascii_download_enable=YES
#
# 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=YES
# (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
#
# 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



일단 설치후 conf 파일에는 간단한 예제로 설정이 되어있다.

뭐 그대로 사용해도 돌아는 가더라만... 그래도 외우진 못해도 어떤 옵션들이 있다는것만이라도 대충 알아둬야 나중에라도 찾아 고칠수 있겠지?

옵션들을 잘 정리해둔 분이 있다.  이분의 포스트를 참고하자.

적당히 옵션을 설정해주고 저장하고 나오자



6. ftp 시작, 종료

[root@localhost vsftpd]# /etc/rc.d/init.d/vsftpd start
vsftpd에 대한 vsftpd을 시작합니다: [  OK  ]
[root@localhost vsftpd]#

[root@localhost vsftpd]# /etc/rc.d/init.d/vsftpd stop
vsftpd 종료 중: [  OK  ]
[root@localhost vsftpd]#


또는

[root@localhost vsftpd]# /etc/init.d/vsftpd start
[root@localhost vsftpd]# /etc/init.d/vsftpd stop

실수로 rc.d 를 뺴먹고 커맨드를 먹였는데 되더라 ㅡ,.ㅡ;;

어떤차이일까? ;;



7. 일단 vsftp 는 실행이 되고 있고, 방화벽을 사용하지 않고 있다면... 바로 사용가능하다.

방화벽을 사용하고 있다면, 방화벽에서 설정을 해주자.


[root@localhost sysconfig]# pwd
/etc/sysconfig
[root@localhost sysconfig]# vi /etc/sysconfig/iptables


# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8103 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
~



[root@localhost sysconfig]#


요렇게 설정해주면 된다. (21번포트를 사용)




8. 이제 방화벽을 내렸다 올려주자.
방화벽을 재시작하기 전 후의 상태(status)를 확인

[root@localhost sysconfig]#
[root@localhost sysconfig]# /sbin/service iptables status
테이블: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination        
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0          
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0          
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:8103
6    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination        
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination        

[root@localhost sysconfig]# /sbin/service iptables stop
iptables: 방화벽 규칙을 지웁니다: [  OK  ]
iptables: chain을 ACCEPT 규칙으로 설정 중:  filter [  OK  ]
iptables: 모듈을 언로드하는 중: [  OK  ]
[root@localhost sysconfig]# /sbin/service iptables start
iptables: 방화벽 규칙 적용 중:  [  OK  ]
[root@localhost sysconfig]#
[root@localhost sysconfig]#
[root@localhost sysconfig]# /sbin/service iptables status
테이블: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination        
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0          
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0          
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:8103
6    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21
7    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination        
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination        

[root@localhost sysconfig]#









04 22, 2011 03:41 04 22, 2011 03:41
iamback 이 작성.

Trackback URL : http://pippen80.cafe24.com/trackback/266

Trackback RSS : http://pippen80.cafe24.com/rss/trackback/266

Trackback ATOM : http://pippen80.cafe24.com/atom/trackback/266


« Prev : 1 : ... 18 : 19 : 20 : 21 : 22 : 23 : 24 : 25 : 26 : ... 251 : Next »