vsftpd does not list content of a directory
I have set up a FTP server using vsftpd
and enabled anonymous upload and download. The problem I have is that when I upload a directory it will be uploaded successfully (I can see it in server), but the next time I want to check that directory, FTP client shows an empty directory!!
There is no error logged in /var/log/vsftpd.log
. The pub
folder (home folder for anonymous ftp user) has also write permission. I tested various config options but none helped!
The latest config options I set are like below:
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirlist_enable=YES
I even turned off firewall once for testing it, but it didn't change anything!
configuration ftp vsftpd
add a comment |
I have set up a FTP server using vsftpd
and enabled anonymous upload and download. The problem I have is that when I upload a directory it will be uploaded successfully (I can see it in server), but the next time I want to check that directory, FTP client shows an empty directory!!
There is no error logged in /var/log/vsftpd.log
. The pub
folder (home folder for anonymous ftp user) has also write permission. I tested various config options but none helped!
The latest config options I set are like below:
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirlist_enable=YES
I even turned off firewall once for testing it, but it didn't change anything!
configuration ftp vsftpd
Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
– user102760
Feb 11 '15 at 15:21
Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution.
– Sarah Weinberger
Dec 11 '15 at 18:27
@SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
– saeedn
Jun 20 '16 at 3:29
add a comment |
I have set up a FTP server using vsftpd
and enabled anonymous upload and download. The problem I have is that when I upload a directory it will be uploaded successfully (I can see it in server), but the next time I want to check that directory, FTP client shows an empty directory!!
There is no error logged in /var/log/vsftpd.log
. The pub
folder (home folder for anonymous ftp user) has also write permission. I tested various config options but none helped!
The latest config options I set are like below:
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirlist_enable=YES
I even turned off firewall once for testing it, but it didn't change anything!
configuration ftp vsftpd
I have set up a FTP server using vsftpd
and enabled anonymous upload and download. The problem I have is that when I upload a directory it will be uploaded successfully (I can see it in server), but the next time I want to check that directory, FTP client shows an empty directory!!
There is no error logged in /var/log/vsftpd.log
. The pub
folder (home folder for anonymous ftp user) has also write permission. I tested various config options but none helped!
The latest config options I set are like below:
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirlist_enable=YES
I even turned off firewall once for testing it, but it didn't change anything!
configuration ftp vsftpd
configuration ftp vsftpd
edited Oct 9 '16 at 16:40
Castaglia
4011411
4011411
asked Feb 1 '12 at 10:52
saeednsaeedn
1,71411315
1,71411315
Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
– user102760
Feb 11 '15 at 15:21
Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution.
– Sarah Weinberger
Dec 11 '15 at 18:27
@SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
– saeedn
Jun 20 '16 at 3:29
add a comment |
Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
– user102760
Feb 11 '15 at 15:21
Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution.
– Sarah Weinberger
Dec 11 '15 at 18:27
@SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
– saeedn
Jun 20 '16 at 3:29
Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
– user102760
Feb 11 '15 at 15:21
Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
– user102760
Feb 11 '15 at 15:21
Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution.
– Sarah Weinberger
Dec 11 '15 at 18:27
Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution.
– Sarah Weinberger
Dec 11 '15 at 18:27
@SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
– saeedn
Jun 20 '16 at 3:29
@SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
– saeedn
Jun 20 '16 at 3:29
add a comment |
7 Answers
7
active
oldest
votes
Two suggestions:
Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory.
The
vsftpd.conf
file can have ahide_file
directive. Depending on the regular expression specified by that directive, anonymous users might not be allowed to see any files.
I've had this problem with vsftpd in the past, and I recall having a vsftpd.conf setting that caused it, so read that config file closely, understand all the params and their values.
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checkedhide_file
, it is not set in config file, which according to unix man page ofvsftd.conf
should be set to (none).
– saeedn
Feb 2 '12 at 6:49
add a comment |
I just forced my VSFTPD to run only in active mode and that seemed to have worked for me. To do that put the following line in your config file:
pasv_enable=NO
What I ended up doing, though, was enabling the passive mode as for some applications it appeared to have been a requirement. It looks like VSFTPD does not play with defaults nicely so it is best to specify your preference explicitly:
pasv_enable=YES
It is also important to get up the correct iptables settings if you are running a firewall. Here are mine, extracted from my /etc/sysconfig/iptables
file:
# FTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1024:65535 -j ACCEPT
add a comment |
Thanks to user81029 for pointing out
sudo setsebool -P allow_ftpd_full_access 1
solves the issue with empty ftp directory after mount --bind
a folder into /var/ftp/ on SELinux
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
add a comment |
Have you considered adding hide_file=NO
?
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
add a comment |
If your config is correct and it's not a firewall issue it could well be SELinux, in my case it was and the answer was:
setsebool -P allow_ftpd_full_access 1
From the man page:
If you want to allow ftp servers to login to local users and
read/write all files on the system, governed by DAC, you must turn on
the allow_ftpd_full_access boolean
add a comment |
if SELinux is enabled, have you tried setenforce 0
command?
Note, it temporarily enters into permissive mode.
add a comment |
If you have tried to list directories by using commands like ls
, dir
that will not help.
If you use any GUI FTP client, for example filezilla
, all directories will be shown.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f30559%2fvsftpd-does-not-list-content-of-a-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
Two suggestions:
Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory.
The
vsftpd.conf
file can have ahide_file
directive. Depending on the regular expression specified by that directive, anonymous users might not be allowed to see any files.
I've had this problem with vsftpd in the past, and I recall having a vsftpd.conf setting that caused it, so read that config file closely, understand all the params and their values.
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checkedhide_file
, it is not set in config file, which according to unix man page ofvsftd.conf
should be set to (none).
– saeedn
Feb 2 '12 at 6:49
add a comment |
Two suggestions:
Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory.
The
vsftpd.conf
file can have ahide_file
directive. Depending on the regular expression specified by that directive, anonymous users might not be allowed to see any files.
I've had this problem with vsftpd in the past, and I recall having a vsftpd.conf setting that caused it, so read that config file closely, understand all the params and their values.
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checkedhide_file
, it is not set in config file, which according to unix man page ofvsftd.conf
should be set to (none).
– saeedn
Feb 2 '12 at 6:49
add a comment |
Two suggestions:
Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory.
The
vsftpd.conf
file can have ahide_file
directive. Depending on the regular expression specified by that directive, anonymous users might not be allowed to see any files.
I've had this problem with vsftpd in the past, and I recall having a vsftpd.conf setting that caused it, so read that config file closely, understand all the params and their values.
Two suggestions:
Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory.
The
vsftpd.conf
file can have ahide_file
directive. Depending on the regular expression specified by that directive, anonymous users might not be allowed to see any files.
I've had this problem with vsftpd in the past, and I recall having a vsftpd.conf setting that caused it, so read that config file closely, understand all the params and their values.
answered Feb 1 '12 at 16:41
Bruce EdigerBruce Ediger
35.3k667120
35.3k667120
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checkedhide_file
, it is not set in config file, which according to unix man page ofvsftd.conf
should be set to (none).
– saeedn
Feb 2 '12 at 6:49
add a comment |
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checkedhide_file
, it is not set in config file, which according to unix man page ofvsftd.conf
should be set to (none).
– saeedn
Feb 2 '12 at 6:49
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checked
hide_file
, it is not set in config file, which according to unix man page of vsftd.conf
should be set to (none).– saeedn
Feb 2 '12 at 6:49
Thanks for suggestions. Yes that directory has write permission. When I restrict write permission to owner, I get permission denied while uploading, so I made it world writable. And I checked
hide_file
, it is not set in config file, which according to unix man page of vsftd.conf
should be set to (none).– saeedn
Feb 2 '12 at 6:49
add a comment |
I just forced my VSFTPD to run only in active mode and that seemed to have worked for me. To do that put the following line in your config file:
pasv_enable=NO
What I ended up doing, though, was enabling the passive mode as for some applications it appeared to have been a requirement. It looks like VSFTPD does not play with defaults nicely so it is best to specify your preference explicitly:
pasv_enable=YES
It is also important to get up the correct iptables settings if you are running a firewall. Here are mine, extracted from my /etc/sysconfig/iptables
file:
# FTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1024:65535 -j ACCEPT
add a comment |
I just forced my VSFTPD to run only in active mode and that seemed to have worked for me. To do that put the following line in your config file:
pasv_enable=NO
What I ended up doing, though, was enabling the passive mode as for some applications it appeared to have been a requirement. It looks like VSFTPD does not play with defaults nicely so it is best to specify your preference explicitly:
pasv_enable=YES
It is also important to get up the correct iptables settings if you are running a firewall. Here are mine, extracted from my /etc/sysconfig/iptables
file:
# FTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1024:65535 -j ACCEPT
add a comment |
I just forced my VSFTPD to run only in active mode and that seemed to have worked for me. To do that put the following line in your config file:
pasv_enable=NO
What I ended up doing, though, was enabling the passive mode as for some applications it appeared to have been a requirement. It looks like VSFTPD does not play with defaults nicely so it is best to specify your preference explicitly:
pasv_enable=YES
It is also important to get up the correct iptables settings if you are running a firewall. Here are mine, extracted from my /etc/sysconfig/iptables
file:
# FTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1024:65535 -j ACCEPT
I just forced my VSFTPD to run only in active mode and that seemed to have worked for me. To do that put the following line in your config file:
pasv_enable=NO
What I ended up doing, though, was enabling the passive mode as for some applications it appeared to have been a requirement. It looks like VSFTPD does not play with defaults nicely so it is best to specify your preference explicitly:
pasv_enable=YES
It is also important to get up the correct iptables settings if you are running a firewall. Here are mine, extracted from my /etc/sysconfig/iptables
file:
# FTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1024:65535 -j ACCEPT
edited Apr 10 '15 at 16:10
A.B.
2,499726
2,499726
answered Mar 13 '15 at 20:06
Boris EpsteinBoris Epstein
212
212
add a comment |
add a comment |
Thanks to user81029 for pointing out
sudo setsebool -P allow_ftpd_full_access 1
solves the issue with empty ftp directory after mount --bind
a folder into /var/ftp/ on SELinux
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
add a comment |
Thanks to user81029 for pointing out
sudo setsebool -P allow_ftpd_full_access 1
solves the issue with empty ftp directory after mount --bind
a folder into /var/ftp/ on SELinux
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
add a comment |
Thanks to user81029 for pointing out
sudo setsebool -P allow_ftpd_full_access 1
solves the issue with empty ftp directory after mount --bind
a folder into /var/ftp/ on SELinux
Thanks to user81029 for pointing out
sudo setsebool -P allow_ftpd_full_access 1
solves the issue with empty ftp directory after mount --bind
a folder into /var/ftp/ on SELinux
answered Jan 2 '17 at 16:58
oleg.blinnikovoleg.blinnikov
212
212
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
add a comment |
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
That was the problem for me on Centos 7.5-1804. Thanks!
– Martin Jambon
Jan 24 at 18:27
add a comment |
Have you considered adding hide_file=NO
?
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
add a comment |
Have you considered adding hide_file=NO
?
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
add a comment |
Have you considered adding hide_file=NO
?
Have you considered adding hide_file=NO
?
edited Feb 3 '12 at 15:12
Mat
39.7k8121128
39.7k8121128
answered Feb 3 '12 at 13:37
fullawarefullaware
111
111
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
add a comment |
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
Yes, I tried it, but it didn't help
– saeedn
Feb 4 '12 at 9:19
add a comment |
If your config is correct and it's not a firewall issue it could well be SELinux, in my case it was and the answer was:
setsebool -P allow_ftpd_full_access 1
From the man page:
If you want to allow ftp servers to login to local users and
read/write all files on the system, governed by DAC, you must turn on
the allow_ftpd_full_access boolean
add a comment |
If your config is correct and it's not a firewall issue it could well be SELinux, in my case it was and the answer was:
setsebool -P allow_ftpd_full_access 1
From the man page:
If you want to allow ftp servers to login to local users and
read/write all files on the system, governed by DAC, you must turn on
the allow_ftpd_full_access boolean
add a comment |
If your config is correct and it's not a firewall issue it could well be SELinux, in my case it was and the answer was:
setsebool -P allow_ftpd_full_access 1
From the man page:
If you want to allow ftp servers to login to local users and
read/write all files on the system, governed by DAC, you must turn on
the allow_ftpd_full_access boolean
If your config is correct and it's not a firewall issue it could well be SELinux, in my case it was and the answer was:
setsebool -P allow_ftpd_full_access 1
From the man page:
If you want to allow ftp servers to login to local users and
read/write all files on the system, governed by DAC, you must turn on
the allow_ftpd_full_access boolean
edited Oct 3 '16 at 19:32
Tomasz
10.2k53068
10.2k53068
answered Oct 3 '16 at 19:19
Oliver DungeyOliver Dungey
1112
1112
add a comment |
add a comment |
if SELinux is enabled, have you tried setenforce 0
command?
Note, it temporarily enters into permissive mode.
add a comment |
if SELinux is enabled, have you tried setenforce 0
command?
Note, it temporarily enters into permissive mode.
add a comment |
if SELinux is enabled, have you tried setenforce 0
command?
Note, it temporarily enters into permissive mode.
if SELinux is enabled, have you tried setenforce 0
command?
Note, it temporarily enters into permissive mode.
answered Feb 24 at 0:01
mikemike
1
1
add a comment |
add a comment |
If you have tried to list directories by using commands like ls
, dir
that will not help.
If you use any GUI FTP client, for example filezilla
, all directories will be shown.
add a comment |
If you have tried to list directories by using commands like ls
, dir
that will not help.
If you use any GUI FTP client, for example filezilla
, all directories will be shown.
add a comment |
If you have tried to list directories by using commands like ls
, dir
that will not help.
If you use any GUI FTP client, for example filezilla
, all directories will be shown.
If you have tried to list directories by using commands like ls
, dir
that will not help.
If you use any GUI FTP client, for example filezilla
, all directories will be shown.
edited May 9 '18 at 17:31
Iskustvo
670219
670219
answered May 9 '18 at 15:28
Rodrigo BashRodrigo Bash
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f30559%2fvsftpd-does-not-list-content-of-a-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Stumbled upon this myself. Many pages have the same question, but often not the (full) answer. It's the PASV ports that need to be reachable in PASV mode. This may need the firewall/IPtables to be adjusted: serverfault.com/questions/421161/…
– user102760
Feb 11 '15 at 15:21
Did you ever solve this problem? I have the same problem now. None of the suggestions mentioned here helps. I also noticed that you never marked any of the answers as the solution.
– Sarah Weinberger
Dec 11 '15 at 18:27
@SarahWeinberger Sorry for the very late reply. No, I couldn't find a solution.
– saeedn
Jun 20 '16 at 3:29