1. vsFTP 설치
[root@vilinux-03 ~]# yum -y install vsftpd
2. /etc/vsftp/vsftpd.conf 설정하기
anonymous_enable=NO
-> 익명의 사용자가 접속할 수 있는지 설정한다. 기본값은 YES로 보안을 위해 NO로 바꿔준다.
local_enable=YES
-> local 사용자가 사용가능한지 설정해준다.
write_enable=YES
-> 접속한 사용자가 write할 수 있는지 설정한다.
local_umask=022
3. vsftp 잘 작동하는지 확인
3-1. 실습을 위해서 방화벽을 꺼준다.(실습을 위해 그냥 다꺼버리는게 속편합니다)
[root@vilinux-03 /]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
3-2. selinux도 꺼준다.(selinux enabled 안바꿨다가 동작하지 않았던 경험이..)
[root@vilinux-03 /]# cat /etc/sysconfig/selinux | grep disabled
# disabled - No SELinux policy is loaded.
SELINUX=disabled
[root@vilinux-03 /]# cat /etc/selinux/config | grep disabled
# disabled - No SELinux policy is loaded.
SELINUX=disabled
3-5. 550 Failed to change directory 오류
ftp> cd /home/yong
550 Failed to change directory.
해결
chroot_local_user=NO
여기서 중요한 문제가 발생한다. chroot 항목을 NO로 풀어버리면 다른 사용자가 상위 디렉토리를 활보하고 다니게 된다. 보안상 굉장히 위험하다.
* 다음 글에선 passvie mode와 active mode의 차이점을 알아보겠습니다!
'리눅스 초급 > FTP' 카테고리의 다른 글
[FTP](5) Passive mode와 Active mode (0) | 2016.05.02 |
---|---|
[FTP](4) FTP와 FileZilla 사용하기 (0) | 2016.05.02 |
[FTP](2) FTP 기본명령어 (0) | 2016.04.28 |
[FTP](1) FTP의 이해 (0) | 2016.04.28 |