# FTP Setup for newbies

## Celcius1

I was wondering is there a ftp howto out there that actually is easy to follow as i have spent the last 3 hrs tryin to setup an ftp server to multiple directories for multiple users and having no luck, i followed a basic setup for VSFTP but when i tried to navigate to other directories it couldnt and wouldnt show the content in those directories and no matter what permissions i setup it just would not work, if someone could help me get out of this bind, and put up a ftp setup for newbies, would be greatly appreciated and dont suggest using a gui for setup as one is not being installed i need instructions on how to do it in the console otherwise i would goto the trouble of installing a gui, and i'm not installing one cause i dont require it on the box.

So any help will be greatly appreciated and if you suggest using a differenet ftp then by all means i will change the one installed but i need to get out of this blasted bind, my head is getting sore from banging my head aganst the screen and getting no where

Celcius1

----------

## audiodef

This is not a direct answer, but it might help you in the long run with your overall understanding of different FTP daemons. 

If you don't have it, emerge eix, then run eix-update. Enter "eix ftp", which should give you a long list. Look over this list, read the descriptions, and try a few different FTP servers. I'm sure you'll find one that's right for you at some point.

----------

## lxg

Celsius1: vsftpd is actually set up quite easily; however, one faulty setting can mess it all up (just like everywhere else).

Can you post your /etc/vsftpd/vsftpd.conf?

```
grep -v -e "^$" -e "^#" /etc/vsftpd/vsftpd.conf
```

Do you want to do anonymous FTP or user-based? (From what you write above, you want user-based, right?)

Can you post any error messages or other hints to your problem?

----------

## Celcius1

i'm not getting error messages i've setup my users they can log in, and see the assigned root dir but no one can navigate the set file structure for the ftp server, i'll post the conf file, but i think its an issue with how i have setup my directories, as i have used symlinks to link the relevant directories to the ftp root directory which is mounts to other drives

/etc/vsftpd/vsftpd.conf

local_enable=yes

write_enable=yes

anonymous_enable=no

xferlog_enable=yes

xferlog_file=/var/log/vsftpd/vsftpd.log

idle_session_timeout=600

data_connection_timeout=120

ascii_upload_enable=no

ascii_download_enable=no

nopriv_user=ftp

dirmessage_enable=yes

ftpd_banner=Torrent Box

chroot_list_enable=no

chroot_local_user=yes

#background=yes

listen=yes

ls_recurse_enable=no

----------

## cwr

FTP (at least, the daemon I use) won't follow symlinks - it's a major security

hole.  You'll have to dig through your docs to see how to override this, or

revise your directory tree.

Will

----------

## Hu

Why are you using ftp instead of something more secure, such as sftp?

Also, when posting configuration files, it can be helpful to use a code tag to make it more readable.

 *Celcius1 wrote:*   

> i think its an issue with how i have setup my directories, as i have used symlinks to link the relevant directories to the ftp root directory which is mounts to other drives
> 
> chroot_local_user=yes

 

```
       chroot_local_user

              If  set  to  YES,  local  users  will  be  (by default) placed in a

              chroot() jail in their home directory after login.   Warning:  This

              option  has  security  implications,  especially  if the users have

              upload permission, or shell access. Only enable if  you  know  what

              you  are  doing.   Note  that  these  security implications are not

              vsftpd specific. They apply to all FTP daemons which offer  to  put

              local users in chroot() jails.

```

Using chroot in conjunction with symbolic links is asking for trouble.  Even if you allow the daemon to follow symbolic links, those links cannot leave the chroot area.  Your post suggests that this is what you tried to do.  It will not work.  Use bind mounts if you must expose other areas.

----------

## Anarcho

I know that PureFTPd can handle these setups as I have it like that. All users have chroot-jails but some have symlinks to directories in e.g. /srv/htdocs/. The users haven't shell access and can't create symlinks through FTP, so I think it is rather safe (also, only 2 personally trusted users have access here).

From the PureFTPd FAQ:

 *Quote:*   

> Symbolic links can be followed when users are chrooted, even when they are pointing out of the chroot jail. This unique feature makes shared content easy to set up.

 

So it looks like this can only be done using PureFTPd.

----------

