# Help wth ftp permissions



## Panthro (Jan 11, 2006)

Hi folks,

I've got a linux machine here running fedora core 4 and vsftp. My problem is I don't seem to be able to set the permissions correctly for /var/www/.

If I try to connect via ftp from another machine using my user login, It connects and sticks me in my /home/Andy/ directory all well and good. The problem comes when I try and change the directory to /var/www/ and I get "550 Failed to change directory".

I have logged in using root and changed the owner of that directory to myself, but still no joy.

Anybody have any ideas? I'm a Linux newbie so I'm probably missing the obvious.


----------



## batty_professor (Jul 29, 2004)

There is an underlying reason for that. var/ is not intended to be a shared directory. For instance, when you download off of a public server, have you ever seen a download come from a var/ directory? More on this later, I must leave for work......


----------



## Panthro (Jan 11, 2006)

OK thanks, so you are suggesting I configure Apache to look in /home/Andy/www/ ?


----------



## LoneWolf071 (Nov 10, 2004)

yes, us apache to runa server, but if you are looking to have a FTP server also that can roam every dir, then you need to mod the vsftpd.conf file.

you connect to your ftp with yor browser, meaning it sees you as anonymous, and the default vsftpd setting is to only allow anonymous ftp users to see that one dir, the one that is in the vsftpd.conf file. 

if i were you, i'd be careful though, because allowing anonymous ftp users to cruise your entire drive could be dangerous. what you should do is make a users, then allow him to login, if you are doing it via a browser, all you need to do is 
ftp://<user>@<address> 
that should then prompt you fora password, enter it and you are home free...


----------



## Squashman (Apr 14, 2005)

What does apache have to do with your FTP.

If you are uploading and downloading files to your website then make a virtual host in your Apache configuration so that you can have your website reside in your home directory.

Why not use SSH instead of VSFTP? I prefer encryption! How about you?


----------



## LoneWolf071 (Nov 10, 2004)

i think he wanted to make ftp act like http... SSH is for just shell, but FTP is for data transferance...


----------



## Squashman (Apr 14, 2005)

LoneWolf071 said:


> i think he wanted to make ftp act like http... SSH is for just shell, but FTP is for data transferance...


I can't remember that last time I used FTP to transfer a file to my server. Have always used SSH.


----------



## LoneWolf071 (Nov 10, 2004)

What SSh Client are you Using?


----------



## Skie (Mar 15, 2003)

Panthro said:


> OK thanks, so you are suggesting I configure Apache to look in /home/Andy/www/ ?


Yes. If you're using Apache, edit your httpd.conf and modify the DocumentRoot to use /home/Andy/www/ instead of /var/www. The reason you can't FTP any files to /var/www is because /var can only be modified by root. /var stores some important files and logs that normal users are not allowed to modify/delete. You could play with the permissions, but this is a security risk. You're much better off using your home dir for your Apache files as you won't need to modify any permissions.


----------



## Skie (Mar 15, 2003)

LoneWolf071 said:


> What SSh Client are you Using?


I recommend using Filezilla which is free and works well. He's referring to SFTP (FTP over SSH). He's still using FTP, it's just being encrypted by SSH.


----------



## Squashman (Apr 14, 2005)

Plenty of them out there.
http://www.ssh.com/support/downloads/secureshellwks/non-commercial.html
http://winscp.net/eng/index.php


----------

