# vsftpd listen port

## SenorLoco

Howdy...alright here is my problem Im running vsftp (obviously) but my isp is blocking port 21 which obviously causes a major problem....so I was wondering...doesn't anyone know how to change the listen port.  I know if its running in standalone mode you can just add listen_port = whatever to the config....but I an using xinitd....so if anyone has any ideas that would be GREAT!!

Thanks, 

SenorLoco

----------

## devon

Would adding a new service to /etc/services (e.g. new-ftp) and then using the new service for the service-name for xinetd work?

/etc/services

```
new-ftp              2121/tcp    #File Transfer [Control]

new-ftp              2121/udp    #File Transfer [Control]
```

xinetd.conf

```
service new-ftp

{

blah = blah

....

}
```

I personally use vsftpd, but I use in standalone mode.

----------

## amne

i think devon's solution should work, anyway, here's mine, too:

i didn't want to touch /etc/services (one more untouched file, so less trouble with ._cfg000_services  :Wink:  ), so i set

```
type            = UNLISTED
```

(if you don't set it to UNLISTED, xinetd will complain about the missing information in /etc/services.

and

```
port            = 12345
```

to set the port in my /etc/xinetd.d/vsftpd

----------

## LJ

what if you don't use xinetd?

----------

## amne

from "man vsftpd.conf":

 *Quote:*   

> listen_port
> 
> If vsftpd is in standalone mode, this is the port it will listen on for incoming FTP connections.
> 
> Default: 21
> ...

 

i think that should do it, but i never tried it myself (as i'm using xinetd).

----------

## iCafe

my gentoo box

use vsftpd but

gentoo ~ #  /etc/init.d/vsftpd start

 * Starting vsftpd...

500 OOPS: bad bool value in config file for: listen   

help me pl........

----------

## DL8

The only way I know is using xinetd. I think redirecting another port to port 21 might also work:

```
iptables -t nat -A PREROUTING -i ! lo -p tcp --dport 2221 -m state --state ! RELATED,ESTABLISHED -j REDIRECT --to-ports 21
```

Good luck

----------

## mudrii

 *DL8 wrote:*   

> The only way I know is using xinetd. I think redirecting another port to port 21 might also work:
> 
> ```
> iptables -t nat -A PREROUTING -i ! lo -p tcp --dport 2221 -m state --state ! RELATED,ESTABLISHED -j REDIRECT --to-ports 21
> ```
> ...

 

ISP is bloking port not local firewall  :Wink: 

----------

## Cqwense

If your ftp is private ( semi-private even ) you could set your firewall to route incoming connections on any given port ( 3547? ) to your server at port 21.  Only catch would be leting your friends know about the non-standard port.  This is basicly what I have to do for port 80, my friends have to come in on port 85

----------

