2011년 12월 25일 일요일

FTP 226 Transfer done (but failed to open directory). 오류해결방법 ...‎

Fedora Core9에 vsftp를 설치하여 사용하다 보면 외부에서 FTP 접속할 경우
아래  표와 같이 디렉토리 목록만 나오고 파일목록이 안나오는 경우가 있다.

230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Transfer done (but failed to open directory).


이럴 경우 "root" 권한으로

SELinux 정책을 일시적으로 끄고 싶을때 (재부팅하면 SELinux의 정책은 원래대로 돌아온다.)
# setenforce 0
다시 켜고 싶을땐
# setenforce 1

영구적으로 SELinux정책을 끄고 싶을때는 아래와 같이 해주면 된다.(이것도 역시 root 권한으로...)
#vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#       targeted - Targeted processes are protected,
#       mls - Multi Level Security protection.
SELINUXTYPE=targeted

위와 같이 "SELINUX="의 값을 "enforcing"에서 "disabled"로 수정 후 저장하면 재부팅 후에도... 쭈욱~ 

출처 : http://mrtroll.tistory.com/entry/%ED%8E%98%EB%8F%84%EB%9D%BC%EC%BD%94%EC%96%B4%EC%97%90%EC%84%9C-SELINUX-%EA%B4%80%EB%A0%A8-%EC%84%A4%EC%A0%95FTP%EA%B4%80%EB%A0%A8

페도라코어에서 SELINUX 관련 설정(FTP관련)

*** SELINUX
# setsebool -P ftp_home_dir 1
페도라 코어 4 까실때 SELinux 로 설정했다면 디폴트로 사용자의 home 디렉토리에 쓰기를 막아놓는다.
SELinux 설정에서 FTP 부분을 변경하자.
# service vsftpd restart
home 디렉토리의 읽고쓰기를 1(True)로 변경하시고 vsftpd 를 재시작.

# setsebool -P ftpd_disable_trans 1
FTP 에 관하여 SELinux 정책을 아예 적용하지 않는 옵션을 설정


- 근데 왜 내꺼에선 setsebool -P ftp_home_dir 1 명령어 입력후 먹통일까... -ㅅ-

댓글 없음:

댓글 쓰기