/etc/vsftpd/vsftp.conf를 수정했는데도 불구하고 500 애러가 나오면서 접속이 안될때는
SELinux 때문이라고 합니다.
# setsebool -P ftp_home_dir=1
이렇게 하면, ftp directory에 대한 접근을 허가 하게된다.
"-P"는 Rebooting 될더라도 값을 저장하여,
정상적으로 동작 하도록 한다.
vsftpd(vsftp 데몬)의 상태를 보기
service vsftpd status
iptables(방화벽)의 상태를 보기
service iptables status
출처 : http://opencode.co.kr/bbs/board.php?bo_table=linux_tips&wr_id=27
-------- 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 정책을 아예 적용하지 않는 옵션을 설정"500 oops: cannot change directory"
Trying to ftp in to a Fedora Core 5 box using a local username. Password is accepted, but the connection is then closed with this error message.
This is because of SELinux's policies. To fix it, issue (as root):setsebool -P ftp_home_dir=1
The -P flag ensures the value is saved after reboot.
------------------------------------------------------------------------------
ftp 정상적인 세팅 상태에서 로그인 후
500 OOPS: cannot change directory
와 같은 메세지가 출력되며 접속이 끊어질 경우 다음과 같이 하면 됩니다.
/etc/selinux/config 에서
SELINUX=permissive
와 같이 바꾸면 됩니다. SELINUX의 Deny를 permissive로..
즉 메세지만 로그에 남기고 접근을 허용하는 것이지요.
enforcing이 기본인데 이것은 접근을 차단하는 것입니다.
"500 oops: cannot change directory"
원인 : SELinux's policies To fix it, issue (as root):
해결 : 터미널(콘솔)창에 아래와 같이 입력하고 엔터. 그러면 적용된다.
# setsebool -P ftp_home_dir=1
옵션 : (-P) 재부팅 후 저장되는 값을 확보한다.
혹시 이명령을 실행 했을 때 이런 메세지가 뜬다면...
"Could not chage policy boolean"
방화벽 설정에가서 ftp서비스가 신뢰할 서비스로 선택되어 있는지 확인한다.
ftp 서비스를 허용해야지만 외부에서 접속할 수 있다.
# system-config-securitylevel // 보안수준 설정창 실행
/etc/vsftpd.conf 를 열어 필요한 옵션의 주석을 제거합니다.
anonymous_enable=YES <- anonymous 가능
local_enable=YES <- 일반 user의 접근 가능
write_enable=YES <- 쓰기 가능
local_umask=022 <- 업로드시 group 과 other 의 읽기 가능
anon_upload_enable=YES <- anonymous 업로드 가능 (관련링크 참조)
ascii_upload_enable=YES <- ASCII 파일 업로드 가능
ascii_download_enable=YES <- ASCII 파일 다운로드 가능
chroot_local_user=YES <- FTP 로그인시, 최상단 디렉토리를 해당유저의 홈계정 안으로 제한
chroot_list_enable=YES <- 유저명이 기입된 리스트의 사용을 활성화
chroot_list_file=/etc/vsftpd.chroot_list <- 유저 리스트의 파일명을 명시 !!! 주의사항 !!! *
chroot_local_user=YES 일 경우, 유저리스트에 기입된 유저: 홈계정 제한을 풀어줄 유저를 의미 *
chroot_local_user=NO 일 경우, 유저리스트에 기입된 유저: 홈계정 제한을 가할 유저를 의미 (혼동하지 않으시길 :-)
/etc/init.d/inetd restart (또는 kill -HUP INETD's_PID)해서 inetd 서버를 재시동하면 vsftpd 가 작동합니다.
출처: http://blog.naver.com/jjongwerny?Redirect=Log&logNo=110017385473