iT邦幫忙

0

無法進入建立好的資料夾裡面以及下載檔案(CentOS7 + Proftp透過MySQL管理帳號跟空間容量)

我有按照此教學頁面來設定Proftp
https://heker86.wordpress.com/2008/10/21/how-to-install-and-configure-proftpd-with-integrate-the-mysql/

我是全部都有設定成功,上傳檔案以及該使用者容量限制都有成功。
只是當我要下載檔案就會出現....

回應:	550 trjetj: No such file or directory
錯誤:	嚴重檔案傳輸錯誤

以及建立資料夾後然後要進入資料夾時候也出現錯誤...

回應:	550 abcdef: No such file or directory
錯誤:	無法取得目錄列表

不知道我哪裡設定有錯誤...請大家幫我解惑一下...感謝
proftpd.conf設定檔案連結
http://1drv.ms/1FjXDgw

sql.conf設定檔案連結
http://1drv.ms/1FjXr0y

附上錯誤訊息的圖片

我是在linode上架設伺服器
OS : CentOS 7
FTP : ProFTPD Version 1.3.5

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

8
wiseguy
iT邦超人 1 級 ‧ 2015-03-15 21:14:18
最佳解答

你參考的文件步驟沒提到要設定 SELinux 權限或是取消 SELinux。測試一下,在系統中輸入命令:

<pre class="c" name="code">setenforce 0

執行之後再到 FTP 試試看。如果就可以了,表示你要設定 SELinux 權限或是取消 SELinux。

看更多先前的回應...收起先前的回應...
Rick Hsu iT邦新手 4 級 ‧ 2015-03-15 21:51:14 檢舉

我的 SELinux 是關閉狀態~

<pre class="c" name="code">
[root@li894 ~]# sestatus
SELinux status:                 disabled
wiseguy iT邦超人 1 級 ‧ 2015-03-16 00:49:38 檢舉

那麼,列出上傳的檔案及建立的目錄屬性看看你的身份能不能存取:

<pre class="c" name="code">ls -al *
Rick Hsu iT邦新手 4 級 ‧ 2015-03-16 02:01:08 檢舉

我這個帳號的 uid 跟 gid 都是 5500

<pre class="c" name="code">
[root@li894-53 slamgundam.com]# ls -al *
-rwxrwxrwx 1 5500 5500    0 Mar 15 03:18 trjetj

abcdef:
total 8
drwxrwxrwx 2 5500 5500 4096 Mar 15 20:33 .
drwxrwxrwx 3 5500 5500 4096 Mar 15 20:33 ..

感覺是群組問題!偷笑

Rick Hsu iT邦新手 4 級 ‧ 2015-03-16 14:30:17 檢舉

這...我不知道哪裡還要做設定....

Rick Hsu iT邦新手 4 級 ‧ 2015-03-16 14:33:20 檢舉

我這個問題出現是當我把QUOTA功能加入後才出現....若只是單純帳號管理的話...是完全沒有上述的問題....我是很需要QUOTA功能...

wiseguy iT邦超人 1 級 ‧ 2015-03-16 15:35:54 檢舉

你的 ls 結果還蠻奇怪的。會把 user:group 列成數字 5500:5500。通常這是代表該 user/group 不存在才會顯示數字。會不會是因為沒有吻合你設在資料庫中的 quota 限制,或找不到這個 user/group,才會不能用?

Rick Hsu iT邦新手 4 級 ‧ 2015-03-16 17:22:54 檢舉

嗯....這是我第一次設定....所以就先照著跑...在資料庫中的uid跟gid都是預設為5500,且資料欄位屬性都是smallint(6)

Rick Hsu iT邦新手 4 級 ‧ 2015-03-16 18:00:26 檢舉

圖片超小....附上圖片載點...
http://1drv.ms/1CkZuko

Rick Hsu iT邦新手 4 級 ‧ 2015-03-17 03:15:00 檢舉

後來我發現...我少做第三步驟...補做之後..還是一樣不行...
目前我能做的動作是...
新增檔案
新增資料夾
刪除檔案
無法刪除資料夾
無法下載檔案跟資料夾
無法進入建立好的資料夾

  1. Create user(ftpuser) and group(ftpgroup) proftpd, I’am assumsing that the group and userid is 2001. Using a number that is free on your system.
wiseguy iT邦超人 1 級 ‧ 2015-03-17 08:53:50 檢舉

再看一次你的 proftpd.conf,可能出在 Umask 022 這個指令,限定了你上傳新檔案、或是建立新目錄,都只能 read,不能刪也無法進入。
你可以先改成 Umask 000 重跑 proftpd 再試試看。如果就可以了,表示真的是這個問題。不過不建議設定成 000,你自己要調整 proftpd 的 runner/group 來配合 ftp user,如何達到不設定成 000,就可以讓 proftpd runner 能夠增刪修所有人上傳的檔案。

Rick Hsu iT邦新手 4 級 ‧ 2015-03-19 11:23:30 檢舉

經過好幾天的糾纏....總算解決了....後來是 VRootEngine 的問題。原本是 on 狀態,後來改成 off 就可以正常執行新增、刪除、修改、下載、上傳、進入資料夾、容量限制。

感謝wiseguy幫忙!!!

<pre class="c" name="code">
<IfModule mod_vroot.c>
  VRootEngine                   off
</IfModule>

出處
https://forums.proftpd.org/smf/index.php?topic=11436.0

我要發表回答

立即登入回答