# New user help with ProFTPd required

## Daniel_PT_Swain

Dear all,

I have had Gentoo installed for 2 weeks now, and it's looking pretty cool. One problem is trying to set up my computer as an FTP server so that other computers on my LAN can retrieve and place data on it.

How do I go about this in Gentoo? I've followed the documentation for proftpd, hosts.allow and hosts.deny the best I can, but ftp connections are still refused.

If anyone can help, it would be much appreciated!

Thanks,

Dan

----------

## Forse

 *Daniel_PT_Swain wrote:*   

> Dear all,
> 
> I have had Gentoo installed for 2 weeks now, and it's looking pretty cool. One problem is trying to set up my computer as an FTP server so that other computers on my LAN can retrieve and place data on it.
> 
> How do I go about this in Gentoo? I've followed the documentation for proftpd, hosts.allow and hosts.deny the best I can, but ftp connections are still refused.
> ...

 

Are you behind firewall/NAT? Try deleting entries from hosts.deny/hosts.allow and see if it helps (maybe missconfigured settings). I am using ProFTPD for a long time and it's by far best ftp server there is. Maybe you missconfigured the proftpd.conf? Maybe you could post it here   :Razz: 

----------

## Daniel_PT_Swain

Forse,

Thanks for your quick reply! I removed the comments from the hosts files as you said, but no difference was made. Yes, I'm behind a firewall, but only wish to connect to it locally, rather than from the other side of the firewall.

I didn't really understand the proftpd.conf when I read about it, so I used the sample file:

---

# This is a basic ProFTPD configuration file (rename it to 

# 'proftpd.conf' for actual use.  It establishes a single server

# and a single anonymous login.  It assumes that you have a user/group

# "nobody" and "ftp" for normal operation and anon.

ServerName          "ProFTPD Default Installation"

ServerType          standalone

DefaultServer       on

RequireValidShell   off

AuthPAM             off

AuthPAMConfig       ftp

# Port 21 is the standard FTP port.

Port				21

# Umask 022 is a good standard umask to prevent new dirs and files

# from being group and world writable.

Umask				022

# To prevent DoS attacks, set the maximum number of child processes

# to 30.  If you need to allow more than 30 concurrent connections

# at once, simply increase this value.  Note that this ONLY works

# in standalone mode, in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd).

MaxInstances			30

# Set the user and group under which the server will run.

User				proftpd

Group				proftpd

# Normally, we want files to be overwriteable.

<Directory />

  AllowOverwrite		on

</Directory>

# A basic anonymous configuration, no upload directories.

<Anonymous ~ftp>

  User				ftp

  Group				ftp

  # We want clients to be able to login with "anonymous" as well as "ftp"

  UserAlias			anonymous ftp

  # Limit the maximum number of anonymous logins

  MaxClients			10

  # We want 'welcome.msg' displayed at login, and '.message' displayed

  # in each newly chdired directory.

  DisplayLogin			welcome.msg

  DisplayFirstChdir		.message

  # Limit WRITE everywhere in the anonymous chroot

  <Limit WRITE>

    DenyAll

  </Limit>

</Anonymous>

----------

## Forse

So you can't connect either as anonymous or normal user? hmm...Did you edit default settings at all? Try restoring default settings and trying then

----------

## sieter

if you want to connect as a

normal user, you probably 

want to turn PamAuth on...

Otherwise, make sure the

ftp-user's homedir exists....

----------

## Daniel_PT_Swain

I tried to do something with inetd.conf, after emerging xinetd, and so I created  an xinetd.conf in /etc, following the guidelines of the manpage:

---

service ftp

{

	socket_type    = stream

	wait           = no

	nice           = 10

        user           = root

	server         = /usr/sbin/proftpd

	server_args    = -1

	log_on_success = DURATION HOST USERID

}

includedir /etc/xinetd.d

---

----------

## Daniel_PT_Swain

 *sieter wrote:*   

> if you want to connect as a
> 
> normal user, you probably 
> 
> want to turn PamAuth on...
> ...

 

Yes, ftp's homedir does exist. What package is PamAuth part of?

----------

## sieter

Sorry, meant

AuthPAM=on

in your config-file...

 :Embarassed: 

----------

## Daniel_PT_Swain

Still no joy - has anyone got any generic versions of the hosts and proftpd.conf files that are known to work, which I could use?

Thanks,

Dan

----------

## mysticalreaper

Daniel

A) Is ProFTPd running?

```
 ps -e | grep proftpd 
```

 will let you know if daemon is running.  (for ease of troubleshooting, don't use inetd or xinetd, just go standalone, as you had in your config file)

B) if if is, can you connect to your yourself?  what happens when you run 

```
ftp 127.0.0.1
```

?  Do you get 'connection refused' or 'no repsonse' or a login prompt?

The critical thing here is that you don't know where along the line proftpd is failing.

----------

## Daniel_PT_Swain

Mysticalreaper,

The output from the terminal is as follows:

bash-2.05b# ps -e | grep proftpd

bash-2.05b# ftp 127.0.0.1

Connected to 127.0.0.1.

421 Service not available, remote server has closed connection

----------

## Diorf

this mean that your server is not running...  :Wink:  If you want it to start automatically with the box just do:

 *Quote:*   

> rc-update add proftpd default

 

and after start it without rebooting by:

 *Quote:*   

> /etc/runlevels/default/proftpd start

 

and then if your config file is right you can connect to your ftp server  :Smile: 

and if you don't want to use xinetd just put the line 

 *Quote:*   

> Server Type standalone

 

in your /etc/proftpd/proftpd.conf (in the global section)

----------

## Daniel_PT_Swain

I've done all that's been said, and you'd think it would work because of that, but it still doesn't...

----------

## Daniel_PT_Swain

 *Daniel_PT_Swain wrote:*   

> I've done all that's been said, and you'd think it would work because of that, but it still doesn't...

 

Apologies, it does now work, after removing xinetd from the default runlevel (and removing it altogether).

Thanks everyone for your help, it's much appreciated! 

Dan  :Smile: 

----------

