LINUX

CentOS7 vsftpd 설치하기

지니 2017. 3. 23. 16:24
반응형



CentOS7 vsftpd 설치하기






1. yum list install vsftpd  // vsftpd 설치여부 확인하는거


2. vsftpd가 설치되어 있지 않으면 vsftpd를 설치한다.

 yum install vsftpd -y


3. yum으로 vsftpd 업데이트

 yum update vsftpd


4. systemctl 명령어로 vsftpd를 시작/중지/상태확인한다.


# systemctl status vsftpd.service <– vsftpd 상태확인

# systemctl start vsftpd.service <– vsftpd 시작

# systemctl stop vsftpd.service <– vsftpd 중지

# systemctl restart vsftpd.service <– vsftpd 재시작


5. yum으로 ftp client설치

# yum install ftp -y


6. vsftpd 자동실행

# systemctl enable vsftpd.service



이후 , netstat -tnlp 실행해 보면 



[root@cobuy-0938 vsftpd]# netstat -tnlp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    

tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1354/sshd           

tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2495/master         

tcp6       0      0 :::3306                 :::*                    LISTEN      2039/mysqld         

tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           

tcp6       0      0 :::80                   :::*                    LISTEN      2905/httpd          

tcp6       0      0 :::21                   :::*                    LISTEN      14389/vsftpd        

tcp6       0      0 :::22                   :::*                    LISTEN      1354/sshd           

tcp6       0      0 ::1:25                  :::*                    LISTEN      2495/master         

tcp6       0      0 :::443                  :::*                    LISTEN      2905/httpd       



21번 포트가 열린게 확인된다.





7. 21번 포트를 에디트플러스(EditPlus) 로 접속하면 이미 만들어둔 파일이 안보이거나 , 553 could not create file 이라고 나올때


http://woorilife.tistory.com/661



위 주소를 보고 따라했더니 해결되었다.



8. 파일이 읽히고 ,쓰이고 ,생성, 삭제가 다 되는데 , 홈디렉토리 위에 상위디렉토리까지 보일때 

(사용자 홈 디렉토리 변경)



vi /etc/vsftpd/vsftpd.conf 


chroot_local_user 를 찾는다. 


없을 수도 있다..(본인은 없었다)


chroot_local_user=YES    <-- 를 추가해준다.


추가후 저장한뒤, vsftpd 를 리스타트를 해준다.


systemctl restart vsftpd.service



그리고서 에디트플러스나 다른 툴로 접속했을때 홈 디렉토리가 변경되었다.


만약 


500 OOPS: vsftpd: refusing to run with writable root inside chroot()



오류가 발생되었다면, 홈디렉토리의 권한이 500이 아닌것이다.


777로 되어있어서 나왔었다.


이럴땐 간단히 


chmod 500 홈디렉토리명

chmod 500 website_aa 


을 하면 된다.


끝~~~



반응형