Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

setting a public ftp server - 500 OOPS: cannot change directory

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
estatistics
Posts: 16
Joined: 2024-02-11 13:32

setting a public ftp server - 500 OOPS: cannot change directory

#1 Post by estatistics »

my dir is "/mnt/temp_dir/photos/stories"

Code: Select all

ls -l
drwxrwxrwx+ 21 nobody nogroup     73728 Mar 12 15:22  stories

Code: Select all

cat /etc/vsftpd.conf 
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
pasv_enable=Yes
pasv_min_port=10000
pasv_max_port=10100
allow_writeable_chroot=YES
user_sub_token=$USER
# user_config_dir=/mnt/temp_dir/photos/stories
local_root=/mnt/temp_dir/photos/stories/$USER  #Not ftpuser exists under 

#user_config_dir=/etc/vsftpd.conf 
userlist_file=/etc/vsftpd.userlist
vsftpd_log_file=/var/log/vsftpd.log

Code: Select all

cat /etc/vsftpd.userlist 
ftpuser

but when do that a 500 oops error appears:

Code: Select all

 ftp 127.0.0.1
Connected to 127.0.0.1.
220 (vsFTPd 3.0.3)
Name (127.0.0.1:eros): ftpuser
331 Please specify the password.
Password: 
500 OOPS: cannot change directory:/mnt/temp_dir/photos/stories
ftp: Login failed
ftp> 

Code: Select all

I have disabled SELinux

Code: Select all

 groups ftpuser
ftpuser : ftpuser sudo users

Code: Select all

getent group|grep -w ftpuser
sudo:x:27:eros,ftpuser
users:x:100:eros,ftpuser
ftpuser:x:1001:

Code: Select all

ftp:x:117:134:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin
ftpuser:x:1001:1001:,,,:/mnt/temp_dir/photos/stories:/bin/bash

estatistics
Posts: 16
Joined: 2024-02-11 13:32

Re: setting a public ftp server - 500 OOPS: cannot change directory

#2 Post by estatistics »

UPDATE
after changing in /etc/passw these lines, output is "login failed"

Code: Select all

ftp:x:117:134:ftp daemon,,,:/mnt/temp_dir/photos/:/srv/ftp:/mnt/temp_dir/photos/stories/:/usr/sbin/nologin
ftpuser:x:1001:1001:,,,:/mnt/temp_dir/photos/:/mnt/temp_dir/photos/stories:/bin/bash

estatistics
Posts: 16
Joined: 2024-02-11 13:32

Re: setting a public ftp server - 500 OOPS: cannot change directory

#3 Post by estatistics »

after changing permissions to the parent folder,

adding

Code: Select all

ftp_username=ftpuser
to vsftpd.conf file,
i successfully login but no files or directories are listed either in bash ftp or in filezila while they exists

Code: Select all

sudo chmod -R 755 /mnt/temp_dir/

Code: Select all

Command:	USER ftpuser
Response:	331 Please specify the password.
Command:	PASS ***
Response:	230 Login successful.
Status:	Server does not support non-ASCII characters.
Status:	Logged in
Status:	Retrieving directory listing...
Command:	PWD
Response:	257 "/" is the current directory
Status:	Directory listing of "/" successful

Code: Select all

ftp 127.0.0.1
Connected to 127.0.0.1.
220 (vsFTPd 3.0.3)
Name (127.0.0.1:eros): ftpuser
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
229 Entering Extended Passive Mode (|||10032|)
150 Here comes the directory listing.
226 Transfer done (but failed to open directory).
ftp> vdir

estatistics
Posts: 16
Joined: 2024-02-11 13:32

Re: setting a public ftp server - 500 OOPS: cannot change directory

#4 Post by estatistics »

solved! making sure that:

Code: Select all

user_sub_token=$USER
local_root=/mnt/temp_dir/photos/stories/$USER
as well creating a directory named ftpuser under stories and then

Code: Select all

sudo chown ftpuser:ftpuser ftpuser/
it worked!

Now, i would like to find how i can get it public.

Post Reply