LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-17-2022, 05:32 AM   #1
pcborges
LQ Newbie
 
Registered: Mar 2022
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Second vsftpd user cannot access defined home at /var/www/html/imageParking


https://www.ryadel.com/en/vsftpd-con...fic-directory/

Hi, I followed the instructions above but the second user gets the following message
when login from filezila:
Comando: USER parking
Resposta: 331 Please specify the password.
Comando: PASS *********
Resposta: 500 OOPS: cannot change directory:/home/parking

user1 works fine.

myname@myhost:/etc$ cat vsftpd.userlist
user1
parking

cat /etc/vsftpd.conf
...
user_config_dir=/etc/vsftpd/user_config_dir/

myname@myhost:/etc/vsftpd/user_config_dir$ ls
user1 parking

myname@myhost:/etc/vsftpd/user_config_dir$ cat parking
local_root=/var/www/html/imageParking
write_enable=YES


myname@myhost:/var/www/html$ ls -l
...
drwxr-xr-x 2 parking parking 4096 Mar 17 06:10 imageParking


What Am I doing wrong?
Assistance welcome.

Last edited by pcborges; 03-17-2022 at 10:29 AM. Reason: text correction
 
Old 03-17-2022, 12:19 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Resposta: 500 OOPS: cannot change directory:/home/parking
Apparently vsftp does not read ther /etc/vsftpd/user_config_dir/parking file where you set the parking user homedir to /var/www/html/imageParking

Check again the configuration and keep in mind that without a "userlist_file" directive, the default userlist_file is /etc/vsftpd.user_list and not /etc/vsftpd.userlist as in your case.
So add the following in vsftpd.conf
Code:
userlist_file=/etc/vsftpd.userlist
 
1 members found this post helpful.
Old 03-17-2022, 01:48 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,738

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
I think the issue is that the home directory does not exist…the error says
Code:
cannot change directory:/home/parking
But the op is expecting
/var/www/html/parking
I think the parking user’s home needs to be set to /var/www/html/parking
See man passwd for how to do that…or if you know how, edit /etc/passwd
Pretty sure that vsftp confg files have nothing to do with it (‘tho I’ve not used any ftp server or client in a long time sftp/ssh is the way to go, IMO)

Last edited by scasey; 03-17-2022 at 01:51 PM.
 
1 members found this post helpful.
Old 03-19-2022, 05:16 AM   #4
pcborges
LQ Newbie
 
Registered: Mar 2022
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: 0
Hi, thank you both for your valuable contribution but not solved the problem yet.
I have started with the most familiar:

Lines that I added to /etc/vsftpd.conf (instructions on the link on my original post):

allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=41000
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/user_config_dir/

myUserName@vps37290:/etc$ cat vsftpd.userlist
user1
parking

myUserName@vps37290:/etc$ ls /etc/vsftpd/user_config_dir
user1 parking

myUserName@vps37290:/etc$ cat /etc/vsftpd/user_config_dir/parking
local_root=/var/www/html/imageParking
write_enable=YES

Somehow user1 works OK:
myUserName@vps37290:/etc$ cat /etc/vsftpd/user_config_dir/user1
local_root=/var/www/html/imageUpload
write_enable=YES

Filezila connects, uploads and can also delete files under user1.

I created user parking after user1 was already working.
Could something be wrong with user parking that prevents him to work with vsftpd?

I am not such an advanced Linux user but will try to look into scasey kind directions as well and see if I can make it work without breaking anything else.
Thank you both.

Last edited by pcborges; 03-19-2022 at 05:20 AM.
 
Old 03-19-2022, 11:39 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Filezila connects, uploads and can also delete files under user1.

I created user parking after user1 was already working.
Could something be wrong with user parking that prevents him to work with vsftpd?
Do you still get the same error: "...cannot change directory:/home/parking"?
Did you restart vsftpd after making changes?
 
Old 03-19-2022, 11:38 PM   #6
pcborges
LQ Newbie
 
Registered: Mar 2022
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: 0
Hi, I did not make any changes, it was already with the lines you suggested.
I did not include the whole set of lines I included in vsftpd.conf because I did not know they were that relevant.
But the vsftpd.conf was always with those lines on my last post.

After that I checked the existence of home/parking an the folder was not there
So I created and rebooted the VM
When it came online I tested with ftpzila and it worked

Thanks

Last edited by pcborges; 03-21-2022 at 07:04 AM.
 
Old 03-21-2022, 11:28 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
After that I checked the existence of home/parking an the folder was not there
So I created and rebooted the VM
When it came online I tested with ftpzila and it worked
You mean that the parking user uses /home/parking in order to upload/download files?
In your OP, you said that the user parking should use the directory /var/www/html/imageParking for this.
 
Old 03-22-2022, 05:44 AM   #8
pcborges
LQ Newbie
 
Registered: Mar 2022
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
You mean that the parking user uses /home/parking in order to upload/download files?
In your OP, you said that the user parking should use the directory /var/www/html/imageParking for this.
No, it is working as intended, now I can upload and remotely delete files from /var/www/html/imageParking logged in as user parking using filezila.

I also aplied proper ownership and access to user parking on its newly created home directory

What I said was that it seems to have started working as soon as I created directory "parking" under /home.
I found that when I decided to login as user parking from terminal and got the message that /home/parking could not be found.
After creating the directory /home/parking for user parking I then tested filezila (as user parking) and everything started to work as intended.

Thanks

Last edited by pcborges; 03-22-2022 at 05:46 AM. Reason: clarification
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I can only access file in /var/www/html from home network kwatts59 Linux - Newbie 9 09-11-2016 02:25 PM
[SOLVED] Create a New User with home dir set to /var/www/html/? wh33t Ubuntu 4 07-16-2015 02:50 AM
User defined linux commands in a user defined shell Sushma05 Linux - Newbie 3 09-13-2013 07:21 AM
[SOLVED] get var value when var name is part of another var bilyboy65 Linux - Newbie 9 10-21-2012 09:32 AM
Creating VSFTPD Full permission User to /var/www/html vibin Linux - General 5 01-03-2006 02:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration