# Howto set up an FTP (VSFTPD)

## guy

A lot of people have been asking about getting an FTP set up. Hopefully this will help...

Before you go, you should have xinet.d set up. If you dont, 

```

emerge xinetd 

rc-update add xinetd default 

```

Now you should be ready for vsftpd: 

```

emerge vsftpd 

 
```

Once that's installed, edit the file /etc/vsftpd/vsftpd.conf to your liking. It's very well documented. Note it is easiest to set accounts through linux's user/groups. You need to add a user/group for the FTP. 

```

groupadd ftpgroup 

useradd -g ftpgroup -d /home/ftp -p password ftpuser 

 
```

Unfortunately I dont know how to get symbolic links to work with vsftp while chrooting is enabled. They DO work if you dont chroot though-- if you don't chroot, you can throw all the symlinks you want in /home/ftp and they should be accessible by your friends (of course you can make /home/ftp anything you want, like /ftp) (to add a link, just do ln -s target_of_link link_location) 

The last step is to go into /etc/xinetd.d/ folder and edit the vsftpd file. Add the line 

only_from 0.0.0.0 to allow any IP to connect and change disable = yes to disable = no. 

Fire up xinetd and all should be good (you can do /etc/init.d/xinetd start)

Please post corrections or other tips..

--Ben

----------

## mcpi

i do the following steps:

- emerge xinetd

- emerge vsftpd

- using /etc/vsftpd/vsftpd.conf (with default setting for testing)

- don't touch /etc/xinetd.conf (so it load the vsftpd - configuration from /etc/xinetd.d/vsftpd)

- editing /etc/xinetd.d/vsftpd

replacing disable = yes ---> disable = no

adding only_from 0.0.0.0

ftp & nobody user exist

-ftp with /home/ftp <-- that doesn't exist (at the moment I don't need it, I need it only if s.b. want to login in - is that correct?) and /bin/false

-nobody with / and /bin/false

logdir

-/var/log/vsftpd exist

/etc/init.d/xinetd exist

- starting xinetd from /etc/init.d/xinetd start

- lsof said xinetd is active

my /var/log/message said:

xinetd Version ... started  ....

Started working: 0 available services            <----- no ftp daemon has been started

netstat doesn't listing any LISTEN port

so xinetd started, no error message is generated, but my vsftpd doesn't started!

what is my mistake?

thanx for all help.

best regards,

pierre

----------

## freebaseh

same problem here vsftpd isnt starting =(

----------

## freebaseh

got it working now 

i change only_from = 0.0.0.0 in /etc/xinetd.conf instead for 

 /etc/xinetd.d/vsftpd 

as mcpi wrote

hope this helps some

----------

## mcpi

i made the changes from freebaseh but it doesn't change anything.

i restarted my xinetd, but it still doesn't load anything. same "error"message like before:

xinetd[1827]: xinetd Version 20030122 started with libwrap loadavg options compiled in.

xinetd[1827]: Started working: 0 available services

any new advices?

thanx for help.

pierre

----------

## elMariachi

Hi.

I've just got the same problem as mcpi has. I had a line Flags = ipv6 (or something like that) in my /etc/xinetd.d/vsftpd file, but i don't have IPv6 configured.. after removing the line it works perfectly. Maybe you made the same mistake?

----------

## cryptodev

Just use OpenSSH with sftp enabled.

----------

## neysx

Or do not use (x)inet if you find it too confusing.

----------

## Gherald2

 *cryptodev wrote:*   

> Just use OpenSSH with sftp enabled.

 

Yeah that's the way to go, but how do you enable sftp?

I'm running non-commercial ssh right now because that's the only way I've gotten the Windows ssh's sftp client to work...  when I try using that client on an gentoo box with openssh it says "sftp-server not in path," or something to that effect.

----------

## neysx

 *Gherald wrote:*   

>  *cryptodev wrote:*   Just use OpenSSH with sftp enabled. 
> 
> Yeah that's the way to go, but how do you enable sftp?
> 
> I'm running non-commercial ssh right now because that's the only way I've gotten the Windows ssh's sftp client to work...  when I try using that client on an gentoo box with openssh it says "sftp-server not in path," or something to that effect.

 Make sure you have a line Subsystem       sftp    /usr/lib/misc/sftp-server in your /etc/ssh/sshd_config file.

Hth

----------

## qubix

maybe you have tried to set up vsftpd to associate usernames with ip-aliases addresses? I want to have 50-some users and 50-some aliases in order for each user to be able to connect to the vsftpd through his own alias. I know that this configuration is friggin' stupid, but one of my customers wants that for "security reasons" (woot). I have read that it is dead-easy to do with vsftpd, but i still haven't found HOW to do it.

Thanks !

----------

## slurve

K, tried everything listed here for changes to xinet conf and vsftp conf (in the order they were listed, didn't undo any changes), and still no luck.  Trying to get ftp working from 2 windows laptops only.  Edited the hosts.allow to include their IP's with ALL, and got hosts.deny with ALL:ALL.

/var/messages not showing the ftp server is running...xinetd.conf has the line includedir /etc/xinetd.d in it....

Thoughts?

----------

## daff

Why not drop xinetd alltogether and start vsftpd in standalone mode?

Add

```

listen=YES

background=YES

```

to /etc/vsftpd/vsftpd.conf, start it via /etc/init.d/vsftpd start and rc-update add vsftpd default.

----------

## slurve

Last step worked, thanks all!

----------

## leni07

Hey I have gotten vsftp to work in standalone mode almost. I can connect and stuff but when i try to do an ls or cd with lftp, i get hung at

 *Quote:*   

> Making Data Connection...

 

I log in as a regular user with lftp -u user,pass mysite.com

It connects

 *Quote:*   

> lftp me@mysite.com >

 

but i cant really do anything after that. Can anyone help me  :Sad: 

----------

## newbie_gentoo

Hello.

I wanted to create an FTP server so my brother could update his site files via FTP. I have sucessfully configured vsftpd without chrooting, so that I could use a symbolic link to his website dir.

Nevertheless, I really don't like that he can go up the dir tree by doing 'cd ..' and be able to download files and everything! This is some serious security problem if anyone can get his ID.

Is there a way to configure vsftpd so that users can only see allowed dirs? Or at least not being able to download from the others?

Thanks for reading

----------

## router

yes I am looking for that too....

----------

## toddles13

Thanks for the "How to"  Guy

The only thing wrong is what freebaseh pointed out

 *freebaseh wrote:*   

> got it working now
> 
> i change only_from = 0.0.0.0 in /etc/xinetd.conf instead for
> 
> /etc/xinetd.d/vsftpd
> ...

 

So the short short version is:

Install xinetd

```
emerge xinetd

rc-update add xinetd default
```

Install vsftp

```
emerge vsftpd
```

edit the file /etc/vsftpd/vsftpd.conf

add the ftpuser

```
groupadd ftpgroup

useradd -g ftpgroup -d /home/ftp -p password ftpuser
```

edit /etc/xinetd.d/vsftpd 

change disable = yes to disable = no

edit /etc/xinetd.conf

add line only_from 0.0.0.0

```
 /etc/init.d/xinetd start
```

Cant seem to get the Chroot thing going. Really need to stop users gonig outside there home directories. But will leave that for another thread.Last edited by toddles13 on Tue Jan 18, 2005 9:55 pm; edited 1 time in total

----------

## frameRATE

thanks for the howto.. got it running myself but used this to add xinetd. Much appreciate stuff like this!

----------

## wjholden

Someone in another thread was asking about how to set up VSFTPD for users with varying power, so I ended up writing a howto on my website.

http://gentoobox.rh.ncsu.edu/vsftpd-help.html

----------

## toddles13

good to hear someone made good of my ramblings, or the original postings ramblings. Good thread. More of these please.

The ultimate n00B

ME!!

----------

## Bob P

 *destuxor wrote:*   

> Someone in another thread was asking about how to set up VSFTPD for users with varying power, so I ended up writing a howto on my website.
> 
> http://gentoobox.rh.ncsu.edu/vsftpd-help.html

 

nice howto.   :Wink: 

----------

## face

 *router wrote:*   

> yes I am looking for that too....

 

mount --bind /var/ftp/music /home/userA/music

----------

## dufeu

 *Bob P wrote:*   

>  *destuxor wrote:*   Someone in another thread was asking about how to set up VSFTPD for users with varying power, so I ended up writing a howto on my website.
> 
> http://gentoobox.rh.ncsu.edu/vsftpd-help.html 
> 
> nice howto.  

 

Unfortunately, I can't get the link to open. It just times out. Does anyone have a copy of this how-to or reasonable facsimile there of they could post?

----------

## mundhra

 *dufeu wrote:*   

>  *Bob P wrote:*    *destuxor wrote:*   Someone in another thread was asking about how to set up VSFTPD for users with varying power, so I ended up writing a howto on my website.
> 
> http://gentoobox.rh.ncsu.edu/vsftpd-help.html 
> 
> nice howto.   
> ...

 

link is old. try http://72.14.253.104/search?q=cache:xMISoN__WygJ:gentoobox.rh.ncsu.edu/vsftpd-help.html+http://gentoobox.rh.ncsu.edu/vsftpd-help.html&hl=en&gl=us&ct=clnk&cd=1.

----------

