Linux/운영

centos 5.X 에서 vsftpd 설정

미나리나물 2012. 2. 7. 18:50
1.vsftpd 가 설치 되어 있는지 우선 확인 한다

CentOS/root>
CentOS/root>rpm -qa | grep vsftpd
vsftpd-2.0.5-12.el5
CentOS/root>

위 내용처럼 기본적으로 vsftpd 가 설치 되어 있습니다.


2.보안수준 설정 창으로 이동후 

CentOS/root>
CentOS/root>system-config-securitylevel



SELinux : 비활성화 시키자


3.vsftpd 환경 설정

CentOS/etc/vsftpd>vsftpd.conf 에서 하면 됩니다.

그리고 FTP 서버에 저장되는 디렉토리나 파일은은

CentOS/var/ftp/pub> 의 밑에 생성이 되고 서버가 구동이 됩니다.


기본적으로 익명 연결할시에 위 폴더가 기본이 됩니다.

4. FTP 재시작
CentOS/>service vsftpd restart
Shutting down vsftpd: [  OK  ]
Starting vsftpd for vsftpd: [  OK  ]
CentOS/>

위와 같이 해주면 됩니다


5.FTP 도 Telnet 마찬가지로 root 계정으로 접속 할수가 없다.

[root@CentOS5 vsftpd]# 
[root@CentOS5 vsftpd]# vi /etc/vsftpd/user_list 

vi 편집기로 열어서 밑에와 같이 root에 #을 붙여주자

# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
bin
daemon
adm
lp
sync
shutdown

저장하고 종료하고 나온후에 


[root@CentOS5 vsftpd]# 
[root@CentOS5 vsftpd]# vi /etc/vsftpd/ftpusers 

vi 편집기로 열어서 밑에와 같이 root에 #을 붙여주자

# Users that are not allowed to login via ftp
#root
bin
daemon
adm
lp
sync
shutdown
halt

이제는 root 로도 ftp 에 접속을 할수가 있게 되었다!



root 로 ftp 접속후 파일 전송까지 테스트를 해보았다!



*참고 사항

이렇게 ftp 설정을 마친후에 다시 재부팅후 ftp 접속이 안된다면 
서비스 자동 시작 설정이 되어 있는지 확인부터 하자

명령어는 ntsysv  

[root@Cent /]# 
[root@Cent /]# ntsysv

위의 명령을 주면 아래와 같이 나온다.
아래 메뉴에서 리눅스 시작시 자동으로 start 시킬 서비스를 추가 하거나 제거해주면 된다.