LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   FTP - changing default directory (https://www.linuxquestions.org/questions/linux-server-73/ftp-changing-default-directory-743160/)

linuxguy08 07-27-2009 01:39 PM

FTP - changing default directory
 
Hi ,

i am running redhat ES 4 nad i need to configure ftp. Basically by default if access through web browser like ftp://ipaddress , it goes to pub only. So i added a line in the configuration vsftpd.conf as
local_root=/data/custdata this is what i need if i type via browser ftp://ipaddress but it doesnot come up rather it show the same default dir /pub only. how to change this to custom directory. pls help me out in this concerns


Thanks

repo 07-27-2009 02:56 PM

Did you restarted vsftpd?

linuxguy08 07-27-2009 04:38 PM

yes , i did but no use again if i do ftp://ipaddress it shows pub dir only.

Suncoast 07-27-2009 06:11 PM

If they are connecting with username/password, that should work, check your folder permissions. (If they are connecting anonymously, use the variable anon_root.) The daemon starts in pub and tries to change into the specified folder, but will "fail silently" if the folder doesn't exist or doesn't have the correct permissions.

linuxguy08 07-28-2009 01:06 PM

It is working via command line in the linux server with the ftp login but through browser type ftp://ipaddres it take into pub directory only and it doesnot ask any login info which i have created for ftp .Do i need to make any change in the configuration

Suncoast 07-28-2009 05:48 PM

You need to add the anon_root=/data/custdata to the vsftpd.conf file.

A word of caution - If anonymous users can write those files, other anonymous users can read it.

Edit - Clarification - If you have anonymous write access, you have no control over miscreants altering or possibly deleting your data.

linuxguy08 07-28-2009 06:57 PM

yes , I added the line anon_root in the config file but it shows the error messages as

500 oops: vsftpd refusing to run with writable anonymous root then i entered ftp login and finally it shows connection interrupted in the browser

Suncoast 07-28-2009 07:39 PM

Ok, looks like anon_root is meant for read-only access, as it really should be.

Create a new user account on your system, and give that account access to your /data/custdata, then connect with the url
Code:

ftp://username@www.mydomain.com
Of course use the actual username and domain name you have. You should be prompted for a password, then dropped into the folder you want.

linuxguy08 07-29-2009 01:44 PM

i created new username gave access to the directory , still it shows the same error like

500 oops: Cannot change directory:/data/cust0011
500 oops: child died
the authentication screen displays behind this error message, after giving login info, it says connection interrupted , the network link was interrupted while negotiating connection

Suncoast 07-29-2009 07:06 PM

That still sounds like a permissions issue.

vishesh 07-30-2009 12:37 AM

Dear
Change owner of /data/cust0011 to new user name
chown -R newusername: /data/cust0011

Also ensure that that user have execute permission on /data

chmod 755 /data

Thanks


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