{"id":55755,"date":"2023-06-24T18:21:13","date_gmt":"2023-06-24T10:21:13","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=55755"},"modified":"2023-06-24T18:21:13","modified_gmt":"2023-06-24T10:21:13","slug":"ubuntu-ftp-service","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ubuntu-ftp-service.html","title":{"rendered":"\u8be6\u89e3\uff1aUbuntu \u4e0b\u5b89\u88c5\u548c\u914d\u7f6e FTP"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nFTP\uff08\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff09\u662f\u4e00\u4e2a\u8f83\u8001\u4e14\u6700\u5e38\u7528\u7684\u6807\u51c6\u7f51\u7edc\u534f\u8bae\uff0c\u7528\u4e8e\u5728\u4e24\u53f0\u8ba1\u7b97\u673a\u4e4b\u95f4\u901a\u8fc7\u7f51\u7edc\u4e0a\u4f20\/\u4e0b\u8f7d\u6587\u4ef6\u3002\u7136\u800c\uff0c FTP \u6700\u521d\u7684\u65f6\u5019\u5e76\u4e0d\u5b89\u5168\uff0c\u56e0\u4e3a\u5b83\u4ec5\u901a\u8fc7\u7528\u6237\u51ed\u8bc1\uff08\u7528\u6237\u540d\u548c\u5bc6\u7801\uff09\u4f20\u8f93\u6570\u636e\uff0c\u6ca1\u6709\u8fdb\u884c\u52a0\u5bc6\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"FTP\uff08\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff09\u662f\u4e00\u4e2a\u8f83\u8001\u4e14\u6700\u5e38\u7528\u7684\u6807\u51c6\u7f51\u7edc\u534f\u8bae\uff0c\u7528\u4e8e\u5728\u4e24\u53f0\u8ba1\u7b97\u673a\u4e4b\u95f4\u901a\u8fc7\u7f51\u7edc\u4e0a\u4f20\/\u4e0b\u8f7d\u6587\u4ef6\u3002\u7136\u800c\uff0c FTP \u6700\u521d\u7684\u65f6\u5019\u5e76\u4e0d\u5b89\u5168\uff0c\u56e0\u4e3a\u5b83\u4ec5\u901a\u8fc7\u7528\u6237\u51ed\u8bc1\uff08\u7528\u6237\u540d\u548c\u5bc6\u7801\uff09\u4f20\u8f93\u6570\u636e\uff0c\u6ca1\u6709\u8fdb\u884c\u52a0\u5bc6\u3002<\/p>\n

\u8b66\u544a\uff1a\u5982\u679c\u4f60\u6253\u7b97\u4f7f\u7528 FTP\uff0c \u9700\u8981\u8003\u8651\u901a\u8fc7 SSL\/TLS\u914d\u7f6e FTP \u8fde\u63a5\u3002\u5426\u5219\uff0c\u4f7f\u7528\u5b89\u5168 FTP\uff0c\u6bd4\u5982 SFTP \u4f1a\u66f4\u597d\u4e00\u4e9b\u3002<\/p>\n

\u5728\u8fd9\u4e2a\u6559\u7a0b\u4e2d\uff0c\u6211\u5c06\u5411\u4f60\u4eec\u5c55\u793a\u5982\u4f55\u5728 Ubuntu \u4e2d\u5b89\u88c5\u3001\u914d\u7f6e\u5e76\u4fdd\u62a4 FTP \u670d\u52a1\u5668\uff08VSFTPD \u7684\u5168\u79f0\u662f \u201cVery Secure FTP Deamon\u201d\uff09\uff0c\u4ece\u800c\u62e5\u6709\u5f3a\u5927\u7684\u5b89\u5168\u6027\uff0c\u80fd\u591f\u9632\u8303 FTP \u6f0f\u6d1e\u3002<\/p>\n

\u7b2c\u4e00\u6b65\uff1a\u5728 Ubuntu \u4e2d\u5b89\u88c5 VSFTPD \u670d\u52a1\u5668<\/strong><\/div>\n

\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u66f4\u65b0\u7cfb\u7edf\u5b89\u88c5\u5305\u5217\u8868\uff0c\u7136\u540e\u50cf\u4e0b\u9762\u8fd9\u6837\u5b89\u88c5 VSFTPD \u4e8c\u8fdb\u5236\u5305\uff1a<\/p>\n

$ sudo apt-get update\r\n$ sudo apt-get install vsftpd\r\n<\/pre>\n

\u4e00\u65e6\u5b89\u88c5\u5b8c\u6210\uff0c\u521d\u59cb\u60c5\u51b5\u4e0b\u670d\u52a1\u88ab\u7981\u7528\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u5f00\u542f\u670d\u52a1\uff0c\u540c\u65f6\uff0c\u542f\u52a8\u5b83\u4f7f\u5f97\u5728\u4e0b\u6b21\u5f00\u673a\u65f6\u80fd\u591f\u81ea\u52a8\u5f00\u542f\u670d\u52a1\uff1a<\/p>\n

------------- On SystemD -------------\r\n# systemctl start vsftpd\r\n# systemctl enable vsftpd\r\n------------- On SysVInit -------------\r\n# service vsftpd start\r\n# chkconfig --level 35 vsftpd on\r\n<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u5982\u679c\u4f60\u5728\u670d\u52a1\u5668\u4e0a\u542f\u7528\u4e86 UFW \u9632\u706b\u5899\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u542f\u7528\uff09\uff0c\u90a3\u4e48\u9700\u8981\u6253\u5f00\u7aef\u53e3 20 \u548c 21 \u2014\u2014 FTP \u5b88\u62a4\u8fdb\u7a0b\u6b63\u5728\u76d1\u542c\u5b83\u4eec\u2014\u2014\u4ece\u800c\u624d\u80fd\u5141\u8bb8\u4ece\u8fdc\u7a0b\u673a\u5668\u8bbf\u95ee FTP \u670d\u52a1\uff0c\u7136\u540e\uff0c\u50cf\u4e0b\u9762\u8fd9\u6837\u6dfb\u52a0\u65b0\u7684\u9632\u706b\u5899\u89c4\u5219\uff1a<\/p>\n

$ sudo ufw allow 20\/tcp\r\n$ sudo ufw allow 21\/tcp\r\n$ sudo ufw status\r\n<\/pre>\n
\u7b2c\u4e8c\u6b65\uff1a\u5728 Ubuntu \u4e2d\u914d\u7f6e\u5e76\u4fdd\u62a4 VSFTPD \u670d\u52a1\u5668<\/strong><\/div>\n

\u8ba9\u6211\u4eec\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\u6765\u8bbe\u7f6e\u548c\u4fdd\u62a4 FTP \u670d\u52a1\u5668\u3002\u9996\u5148\uff0c\u6211\u4eec\u50cf\u4e0b\u9762\u8fd9\u6837\u521b\u5efa\u4e00\u4e2a\u539f\u59cb\u914d\u7f6e\u6587\u4ef6 \/etc\/vsftpd\/vsftpd.conf<\/span> \u7684\u5907\u4efd\u6587\u4ef6\uff1a<\/p>\n

$ sudo cp \/etc\/vsftpd.conf \/etc\/vsftpd.conf.orig\r\n<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u6253\u5f00 vsftpd \u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

$ sudo vi \/etc\/vsftpd.conf\r\nOR\r\n$ sudo nano \/etc\/vsftpd.conf\r\n<\/pre>\n

\u628a\u4e0b\u9762\u7684\u8fd9\u4e9b\u9009\u9879\u6dfb\u52a0\/\u6539\u6210\u6240\u5c55\u793a\u7684\u503c\uff1a<\/p>\n

anonymous_enable=NO             # \u5173\u95ed\u533f\u540d\u767b\u5f55\r\nlocal_enable=YES        # \u5141\u8bb8\u672c\u5730\u7528\u6237\u767b\u5f55\r\nwrite_enable=YES        # \u542f\u7528\u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u7684 FTP \u547d\u4ee4\r\nlocal_umask=022             # \u672c\u5730\u7528\u6237\u521b\u5efa\u6587\u4ef6\u7684 umask \u503c\r\ndirmessage_enable=YES           # \u5f53\u7528\u6237\u7b2c\u4e00\u6b21\u8fdb\u5165\u65b0\u76ee\u5f55\u65f6\u663e\u793a\u63d0\u793a\u6d88\u606f\r\nxferlog_enable=YES      # \u4e00\u4e2a\u5b58\u6709\u8be6\u7ec6\u7684\u4e0a\u4f20\u548c\u4e0b\u8f7d\u4fe1\u606f\u7684\u65e5\u5fd7\u6587\u4ef6\r\nconnect_from_port_20=YES        # \u5728\u670d\u52a1\u5668\u4e0a\u9488\u5bf9 PORT \u7c7b\u578b\u7684\u8fde\u63a5\u4f7f\u7528\u7aef\u53e3 20\uff08FTP \u6570\u636e\uff09\r\nxferlog_std_format=YES          # \u4fdd\u6301\u6807\u51c6\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f\r\nlisten=NO               # \u963b\u6b62 vsftpd \u5728\u72ec\u7acb\u6a21\u5f0f\u4e0b\u8fd0\u884c\r\nlisten_ipv6=YES             # vsftpd \u5c06\u76d1\u542c ipv6 \u800c\u4e0d\u662f IPv4\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u7f51\u7edc\u60c5\u51b5\u8bbe\u7f6e\r\npam_service_name=vsftpd         # vsftpd \u5c06\u4f7f\u7528\u7684 PAM \u9a8c\u8bc1\u8bbe\u5907\u7684\u540d\u5b57\r\nuserlist_enable=YES             # \u5141\u8bb8 vsftpd \u52a0\u8f7d\u7528\u6237\u540d\u5b57\u5217\u8868\r\ntcp_wrappers=YES        # \u6253\u5f00 tcp \u5305\u88c5\u5668\r\n<\/pre>\n

\u73b0\u5728\uff0c\u914d\u7f6e VSFTPD \uff0c\u57fa\u4e8e\u7528\u6237\u5217\u8868\u6587\u4ef6\/etc\/vsftpd.userlist<\/span> \u6765\u5141\u8bb8\u6216\u62d2\u7edd\u7528\u6237\u8bbf\u95ee FTP\u3002<\/p>\n

\u6ce8\u610f\uff0c\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u901a\u8fc7userlist_enable=YES<\/span> \u542f\u7528\u4e86\u7528\u6237\u5217\u8868\uff0c\u4e14\u8bbe\u7f6euserlist_deny=YES<\/span> \u65f6\uff0c\u90a3\u4e48\uff0c\u7528\u6237\u5217\u8868\u6587\u4ef6\/etc\/vsftpd.userlist<\/span> \u4e2d\u7684\u7528\u6237\u662f\u4e0d\u80fd\u767b\u5f55\u8bbf\u95ee\u7684\u3002<\/p>\n

\u4f46\u662f\uff0c\u9009\u9879userlist_deny=NO<\/span> \u5219\u53cd\u8f6c\u4e86\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u6709\u7528\u6237\u540d\u88ab\u660e\u786e\u5217\u51fa\u5728\/etc\/vsftpd.userlist<\/span> \u4e2d\u7684\u7528\u6237\u624d\u5141\u8bb8\u767b\u5f55\u5230 FTP \u670d\u52a1\u5668\u3002<\/p>\n

userlist_enable=YES                   # vsftpd \u5c06\u4f1a\u4ece\u6240\u7ed9\u7684\u7528\u6237\u5217\u8868\u6587\u4ef6\u4e2d\u52a0\u8f7d\u7528\u6237\u540d\u5b57\u5217\u8868\r\nuserlist_file=\/etc\/vsftpd.userlist    # \u5b58\u50a8\u7528\u6237\u540d\u5b57\u7684\u5217\u8868\r\nuserlist_deny=NO\r\n<\/pre>\n

\u91cd\u8981\u7684\u662f\uff0c\u5f53\u7528\u6237\u767b\u5f55 FTP \u670d\u52a1\u5668\u4ee5\u540e\uff0c\u4ed6\u4eec\u5c06\u8fdb\u5165 chrooted \u73af\u5883\uff0c\u5373\u5f53\u5728 FTP \u4f1a\u8bdd\u65f6\uff0c\u5176 root \u76ee\u5f55\u5c06\u662f\u5176 home \u76ee\u5f55\u3002<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u6765\u770b\u4e00\u770b\u4e24\u79cd\u53ef\u80fd\u7684\u9014\u5f84\u6765\u8bbe\u7f6e chrooted\uff08\u672c\u5730 root\uff09\u76ee\u5f55\uff0c\u6b63\u5982\u4e0b\u9762\u6240\u5c55\u793a\u7684\u3002<\/p>\n

\u8fd9\u65f6\uff0c\u8ba9\u6211\u4eec\u6dfb\u52a0\/\u4fee\u6539\/\u53d6\u6d88\u8fd9\u4e24\u4e2a\u9009\u9879\u6765\u5c06 FTP \u7528\u6237\u9650\u5236\u5728\u5176 home \u76ee\u5f55<\/p>\n

chroot_local_user=YES\r\nallow_writeable_chroot=YES\r\n<\/pre>\n

\u9009\u9879chroot_local_user=YES<\/span> \u610f\u5473\u7740\u672c\u5730\u7528\u6237\u5c06\u8fdb\u5165 chroot \u73af\u5883\uff0c\u5f53\u767b\u5f55\u4ee5\u540e\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u5176 home \u76ee\u5f55\u3002<\/p>\n

\u5e76\u4e14\u6211\u4eec\u8981\u77e5\u9053\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0cVSFTPD \u4e0d\u5141\u8bb8 chroot \u76ee\u5f55\u5177\u6709\u53ef\u5199\u6743\u9650\u3002\u7136\u800c\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u9009\u9879 allow_writeable_chroot=YES<\/span> \u6765\u6539\u53d8\u8fd9\u4e2a\u8bbe\u7f6e<\/p>\n

\u4fdd\u5b58\u6587\u4ef6\u7136\u540e\u5173\u95ed\u3002\u73b0\u5728\u6211\u4eec\u9700\u8981\u91cd\u542f VSFTPD \u670d\u52a1\u4ece\u800c\u4f7f\u4e0a\u9762\u7684\u8fd9\u4e9b\u66f4\u6539\u751f\u6548\uff1a<\/p>\n

------------- On SystemD -------------\r\n# systemctl restart vsftpd\r\n------------- On SysVInit -------------\r\n# service vsftpd restart\r\n<\/pre>\n
\u7b2c\u4e09\u6b65\uff1a\u5728 Ubuntu \u4e0a\u6d4b\u8bd5 VsFTP \u670d\u52a1\u5668<\/strong><\/div>\n

\u73b0\u5728\uff0c\u6211\u4eec\u901a\u8fc7\u4f7f\u7528\u4e0b\u9762\u5c55\u793a\u7684 useradd \u547d\u4ee4\u521b\u5efa\u4e00\u4e2a FTP \u7528\u6237\u6765\u6d4b\u8bd5 FTP \u670d\u52a1\u5668\uff1a<\/p>\n

$ sudo useradd -m -c \"Aaron Kili, Contributor\" -s \/bin\/bash aaronkilik\r\n$ sudo passwd aaronkilik\r\n<\/pre>\n

\u7136\u540e\uff0c\u6211\u4eec\u9700\u8981\u50cf\u4e0b\u9762\u8fd9\u6837\u4f7f\u7528 echo \u547d\u4ee4\u548c tee \u547d\u4ee4\u6765\u660e\u786e\u5730\u5217\u51fa\u6587\u4ef6\/etc\/vsftpd.userlist<\/span> \u4e2d\u7684\u7528\u6237 aaronkilik\uff1a<\/p>\n

$ echo \"aaronkilik\" | sudo tee -a \/etc\/vsftpd.userlist\r\n$ cat \/etc\/vsftpd.userlist\r\n<\/pre>\n

\u73b0\u5728\uff0c\u662f\u65f6\u5019\u6765\u6d4b\u8bd5\u4e0a\u9762\u7684\u914d\u7f6e\u662f\u5426\u5177\u6709\u6211\u4eec\u60f3\u8981\u7684\u529f\u80fd\u4e86\u3002\u6211\u4eec\u9996\u5148\u6d4b\u8bd5\u533f\u540d\u767b\u5f55\uff1b\u6211\u4eec\u53ef\u4ee5\u4ece\u4e0b\u9762\u7684\u8f93\u51fa\u4e2d\u5f88\u6e05\u695a\u7684\u770b\u5230\uff0c\u5728\u8fd9\u4e2a FTP \u670d\u52a1\u5668\u4e2d\u662f\u4e0d\u5141\u8bb8\u533f\u540d\u767b\u5f55\u7684\uff1a<\/p>\n

# ftp 192.168.56.102\r\nConnected to 192.168.56.102  (192.168.56.102).\r\n220 Welcome to TecMint.com FTP service.\r\nName (192.168.56.102:aaronkilik) : anonymous\r\n530 Permission denied.\r\nLogin failed.\r\nftp> bye\r\n221 Goodbye.\r\n<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6d4b\u8bd5\uff0c\u5982\u679c\u7528\u6237\u7684\u540d\u5b57\u6ca1\u6709\u5728\u6587\u4ef6\/etc\/vsftpd.userlist<\/span> \u4e2d\uff0c\u662f\u5426\u80fd\u591f\u767b\u5f55\u3002\u4ece\u4e0b\u9762\u7684\u8f93\u51fa\u4e2d\uff0c\u6211\u4eec\u770b\u5230\uff0c\u8fd9\u662f\u4e0d\u53ef\u4ee5\u7684\uff1a<\/p>\n

# ftp 192.168.56.102\r\nConnected to 192.168.56.102  (192.168.56.102).\r\n220 Welcome to TecMint.com FTP service.\r\nName (192.168.56.10:root) : user1\r\n530 Permission denied.\r\nLogin failed.\r\nftp> bye\r\n221 Goodbye.\r\n<\/pre>\n

\u73b0\u5728\uff0c\u6211\u4eec\u5c06\u8fdb\u884c\u6700\u540e\u4e00\u9879\u6d4b\u8bd5\uff0c\u6765\u786e\u5b9a\u5217\u5728\u6587\u4ef6\/etc\/vsftpd.userlist<\/span> \u6587\u4ef6\u4e2d\u7684\u7528\u6237\u767b\u5f55\u4ee5\u540e\uff0c\u662f\u5426\u5b9e\u9645\u5904\u4e8e home \u76ee\u5f55\u3002\u4ece\u4e0b\u9762\u7684\u8f93\u51fa\u4e2d\u53ef\u77e5\uff0c\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n

# ftp 192.168.56.102\r\nConnected to 192.168.56.102  (192.168.56.102).\r\n220 Welcome to TecMint.com FTP service.\r\nName (192.168.56.102:aaronkilik) : aaronkilik\r\n331 Please specify the password.\r\nPassword:\r\n230 Login successful.\r\nRemote system type is UNIX.\r\nUsing binary mode to transfer files.\r\nftp> ls<\/pre>\n

\"\"<\/p>\n

\u5728 Ubuntu \u4e2d\u786e\u8ba4 FTP \u767b\u5f55<\/em><\/strong><\/p>\n

\u8b66\u544a\uff1a\u8bbe\u7f6e\u9009\u9879allow_writeable_chroot=YES<\/span> \u662f\u5f88\u5371\u9669\u7684\uff0c\u7279\u522b\u662f\u5982\u679c\u7528\u6237\u5177\u6709\u4e0a\u4f20\u6743\u9650\uff0c\u6216\u8005\u53ef\u4ee5 shell \u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u5f88\u53ef\u80fd\u4f1a\u51fa\u73b0\u5b89\u5168\u95ee\u9898\u3002\u53ea\u6709\u5f53\u4f60\u786e\u5207\u7684\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48\u7684\u65f6\u5019\uff0c\u624d\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\u3002<\/p>\n

\u6211\u4eec\u9700\u8981\u6ce8\u610f\uff0c\u8fd9\u4e9b\u5b89\u5168\u95ee\u9898\u4e0d\u4ec5\u4f1a\u5f71\u54cd\u5230 VSFTPD\uff0c\u4e5f\u4f1a\u5f71\u54cd\u8ba9\u672c\u5730\u7528\u6237\u8fdb\u5165 chroot \u73af\u5883\u7684 FTP daemon\u3002<\/p>\n

\u56e0\u4e3a\u8fd9\u4e9b\u539f\u56e0\uff0c\u5728\u4e0b\u4e00\u6b65\u4e2d\uff0c\u6211\u5c06\u9610\u8ff0\u4e00\u4e2a\u66f4\u5b89\u5168\u7684\u65b9\u6cd5\uff0c\u6765\u5e2e\u52a9\u7528\u6237\u8bbe\u7f6e\u4e00\u4e2a\u975e\u53ef\u5199\u672c\u5730 root \u76ee\u5f55\u3002<\/p>\n

\u7b2c\u56db\u6b65\uff1a\u5728 Ubuntu \u4e2d\u914d\u7f6e FTP \u7528\u6237\u7684 Home \u76ee\u5f55<\/strong><\/div>\n

\u73b0\u5728\uff0c\u518d\u6b21\u6253\u5f00 VSFTPD \u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

$ sudo vi \/etc\/vsftpd.conf\r\nOR\r\n$ sudo nano \/etc\/vsftpd.conf\r\n<\/pre>\n

\u7136\u540e\u50cf\u4e0b\u9762\u8fd9\u6837\u7528#<\/span> \u628a\u4e0d\u5b89\u5168\u9009\u9879\u6ce8\u91ca\u4e86\uff1a<\/p>\n

#allow_writeable_chroot=YES\r\n<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u4e3a\u7528\u6237\u521b\u5efa\u4e00\u4e2a\u66ff\u4ee3\u7684\u672c\u5730 root \u76ee\u5f55\uff08aaronkilik\uff0c\u4f60\u7684\u53ef\u80fd\u548c\u8fd9\u4e0d\u4e00\u6837\uff09\uff0c\u7136\u540e\u8bbe\u7f6e\u76ee\u5f55\u6743\u9650\uff0c\u53d6\u6d88\u5176\u4ed6\u6240\u6709\u7528\u6237\u5bf9\u6b64\u76ee\u5f55\u7684\u5199\u5165\u6743\u9650\uff1a<\/p>\n

$ sudo mkdir \/home\/aaronkilik\/ftp\r\n$ sudo chown nobody:nogroup \/home\/aaronkilik\/ftp\r\n$ sudo chmod a-w \/home\/aaronkilik\/ftp\r\n<\/pre>\n

\u7136\u540e\uff0c\u5728\u672c\u5730 root \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u5408\u9002\u6743\u9650\u7684\u76ee\u5f55\uff0c\u7528\u6237\u5c06\u5728\u8fd9\u513f\u5b58\u50a8\u6587\u4ef6\uff1a<\/p>\n

$ sudo mkdir \/home\/aaronkilik\/ftp\/files\r\n$ sudo chown -R aaronkilk:aaronkilik \/home\/aaronkilik\/ftp\/files\r\n$ sudo chmod -R 0770 \/home\/aaronkilik\/ftp\/files\/\r\n<\/pre>\n

\u4e4b\u540e\uff0c\u5c06 VSFTPD \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u4e0b\u9762\u8fd9\u4e9b\u9009\u9879\u6dfb\u52a0\/\u4fee\u6539\u4e3a\u76f8\u5e94\u7684\u503c\uff1a<\/p>\n

user_sub_token=$USER          # \u5728\u672c\u5730 root \u76ee\u5f55\u4e2d\u63d2\u5165\u7528\u6237\u540d\r\nlocal_root=\/home\/$USER\/ftp    # \u5b9a\u4e49\u5404\u4e2a\u7528\u6237\u7684\u672c\u5730 root \u76ee\u5f55\r\n<\/pre>\n

\u4fdd\u5b58\u6587\u4ef6\u5e76\u5173\u95ed\u3002\u7136\u540e\u91cd\u542f VSFTPD \u670d\u52a1\u6765\u4f7f\u4e0a\u9762\u7684\u8bbe\u7f6e\u751f\u6548\uff1a<\/p>\n

------------- On SystemD -------------\r\n# systemctl restart vsftpd\r\n------------- On SysVInit -------------\r\n# service vsftpd restart\r\n<\/pre>\n

\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u6765\u6700\u540e\u68c0\u67e5\u4e00\u4e0b\uff0c\u786e\u4fdd\u7528\u6237\u7684\u672c\u5730 root \u76ee\u5f55\u662f\u6211\u4eec\u5728\u4ed6\u7684 Home \u76ee\u5f55\u4e2d\u521b\u5efa\u7684 FTP \u76ee\u5f55\u3002<\/p>\n

# ftp 192.168.56.102\r\nConnected to 192.168.56.102  (192.168.56.102).\r\n220 Welcome to TecMint.com FTP service.\r\nName (192.168.56.10:aaronkilik) : aaronkilik\r\n331 Please specify the password.\r\nPassword:\r\n230 Login successful.\r\nRemote system type is UNIX.\r\nUsing binary mode to transfer files.\r\nftp> ls\r\n<\/pre>\n

\"\"<\/p>\n

FTP \u7528\u6237 Home \u76ee\u5f55\u767b\u5f55<\/em><\/strong><\/p>\n

 <\/p>\n


\n

via: http:\/\/www.tecmint.com\/install-ftp-server-in-ubuntu\/<\/a><\/p>\n

\u4f5c\u8005\uff1aAaron Kili<\/a> \u8bd1\u8005\uff1aucasFL<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n

\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8312-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/ubuntu-ftp-service.html<\/a>\u7f16\u8f91\u5458\uff1a\u5f20\u96c4\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

FTP\uff08\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff09\u662f\u4e00\u4e2a\u8f83\u8001\u4e14\u6700\u5e38\u7528\u7684\u6807\u51c6\u7f51\u7edc\u534f\u8bae\uff0c\u7528\u4e8e\u5728\u4e24\u53f0\u8ba1\u7b97\u673a\u4e4b\u95f4\u901a\u8fc7\u7f51\u7edc\u4e0a\u4f20\/\u4e0b\u8f7d\u6587\u4ef6\u3002\u7136\u800c\uff0c FTP \u6700\u521d\u7684\u65f6\u5019\u5e76\u4e0d\u5b89\u5168\uff0c\u56e0\u4e3a\u5b83\u4ec5\u901a\u8fc7\u7528\u6237\u51ed\u8bc1\uff08\u7528\u6237\u540d\u548c\u5bc6\u7801\uff09\u4f20\u8f93\u6570\u636e\uff0c\u6ca1\u6709\u8fdb\u884c\u52a0\u5bc6\u3002<\/p>\n","protected":false},"author":643,"featured_media":55780,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-55755","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/55755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=55755"}],"version-history":[{"count":13,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/55755\/revisions"}],"predecessor-version":[{"id":275700,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/55755\/revisions\/275700"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/55780"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=55755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=55755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=55755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}