安装proftp
安裝proftp
1、下載proftp(windows上下載更快)
wget???ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.5d.tar.gz2、解壓、編譯、安裝
tar?-zxvf?proftpd-1.3.5d.tar.gz cd?proftpd-1.3.5./configure?--prefix=/opt/proftpd?--sysconfdir=/etc make make?install3、添加用戶ftp運(yùn)行的用戶
新建ftp的主目錄,則ftp用只有該目錄權(quán)限,沒有其他目錄權(quán)限,但是區(qū)別于系統(tǒng)用戶amos就有所有目錄的權(quán)限 mkdir?/opt/ftp chmod?777?/opt/ftp/添加一個(gè)ftp賬號(hào)的組 groupadd??ftpusers 添加一個(gè)ftp賬號(hào) useradd?-d?/opt/ftp?-g?ftpusers?-s?/sbin/nologin?ftpuser5passwd?ftpuser5 更改用戶?ftpuser5?的密碼?。 新的?密碼: 重新輸入新的?密碼:#ftp?運(yùn)行帳號(hào)的用戶,設(shè)置root,進(jìn)程是root權(quán)限,設(shè)置amos,進(jìn)程是amos權(quán)限 vim?/etc/proftpd.conf? #?Set?the?user?and?group?under?which?the?server?will?run. User????????????????????????????root Group???????????????????????????root4、設(shè)置ftp權(quán)限的用戶組
#?To?cause?every?FTP?user?to?be?"jailed"?(chrooted)?into?their?home #?directory,?uncomment?this?line.#使每個(gè)FTP用戶被“監(jiān)禁”(用)到他們的主目錄,注釋掉這行。 DefaultRoot?~?ftpusers?#這里讓ftpusers用戶組中的用戶ftpuser5只有/opt/ftp目錄權(quán)限5、啟動(dòng)proftp
?/opt/proftpd/sbin/proftpd6、登陸ftp
[root@133?tmp]#?ps?aux?|?grep?ftp suser????26332??0.0??0.0??17748??1420??????????Ss???18:22???0:00?proftpd:?(accepting?connections) root?????31285??0.0??0.0?103320???916?pts/5????S+???22:02???0:00?grep?ftp [root@133?centos_system_init]#?ftp?127.0.0.1 Connected?to?127.0.0.1?(127.0.0.1). 220?ProFTPD?1.3.5?Server?(ProFTPD?Default?Installation)?[127.0.0.1] Name?(127.0.0.1:root):?ftpuser5 331?Password?required?for?ftpuser5 Password:? 230?User?ftpuser5?logged?in Remote?system?type?is?UNIX. Using?binary?mode?to?transfer?files. ftp>?pwd??#/opt/ftp是ftpuser5的主目錄,沒有其他目錄權(quán)限 257?"/"?is?the?current?directory ftp>?ls 227?Entering?Passive?Mode?(127,0,0,1,178,205). 150?Opening?ASCII?mode?data?connection?for?file?list 226?Transfer?complete ftp>?mkdir?test1 257?"/test1"?-?Directory?successfully?created ftp>?ls?/ 227?Entering?Passive?Mode?(127,0,0,1,146,45). 150?Opening?ASCII?mode?data?connection?for?file?list drwxr-xr-x???2?ftpuser5?ftpusers?????4096?Feb?20?08:35?test1 226?Transfer?complete ftp>?exit 221?Goodbye. [root@133?centos_system_init]#?ls?/opt/ftp/ test1
7、匿名用戶是可以登陸的,如果不允許匿名用戶登陸,需要注釋以下內(nèi)容,然后重啟服務(wù)
[root@133?centos_system_init]#?ftp?127.0.0.1 Connected?to?127.0.0.1?(127.0.0.1). 220?ProFTPD?1.3.5?Server?(ProFTPD?Default?Installation)?[127.0.0.1] Name?(127.0.0.1:root):?ftp?/anonymous 331?Anonymous?login?ok,?send?your?complete?email?address?as?your?password Password:vim?/etc/proftpd.conf #?A?basic?anonymous?configuration,?no?upload?directories.??If?you?do?not #?want?anonymous?users,?simply?delete?this?entire?<Anonymous>?section. <Anonymous?~ftp> #??User??????????????????????????ftp #??Group?????????????????????????ftp#?We?want?clients?to?be?able?to?login?with?"anonymous"?as?well?as?"ftp" #??UserAlias?????????????????????anonymous?ftp轉(zhuǎn)載于:https://blog.51cto.com/daixuan/1899128
總結(jié)
- 上一篇: 【转】你应该了解的基础和2017测试行业
- 下一篇: cassandra的命令