Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

linxux proftp connection refused

Posted on 2007-12-02
11
Medium Priority
?
1,371 Views
Last Modified: 2013-12-15
I swear, I go through this same problem every time I set up Linux, but I keep losing track of the solution.

I have a new Linux box, kernel version 2.6.21. It is on an office lan whose others hosts are all Windows boxes. I can 'run -> ftp hostname' from any windows worstation out into the real world, but I can't ftp to this linux box. I get 'connection refused'. On the linux machine I try "ftp localhost", same thing. I have enabled proftpd in inet.conf, put "windowshost: ALL" into my hosts.allow file and done 'kill -HUP 1' to restart inetd. No go. What more do I need to do?
0
Comment
Question by:jmarkfoley
11 Comments
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 20392374
As root, do an "lsof -i" and verify that inetd really is listening on port 21. "Connection refused" would indicate that it doesn't.
0
 
LVL 7

Expert Comment

by:Wod
ID: 20392400
Try this:
~# chmod +x /etc/rc.d/rc.proftpd
~# /etc/rc.d/rc.proftpd start
~# ftp localhost

if it works, it should now start automatically on boot

0
 
LVL 1

Expert Comment

by:abspm24
ID: 20394504
Hi,
first check firewall settings, allow 21 port if firewall is eanbled
second, check the logs (/var/log/messages) for any information
AB
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 1

Author Comment

by:jmarkfoley
ID: 20462856
duncan_roe: when I run "lsof -i" there is nothing for ftp

wod: I am ftp'ing to another linux host fine that does not use rc.proftpd. I assume that one is just using services/inetd.conf. These appear to be configured propery on the 'bad' machine. the proftpd.conf files are identical on both.

When I run proftpd -t (test config file) I get:
 - IPv6 getaddrinfo 'webserver.ohprs.org' error: Name or service not known

When I run 'proftpd -n -d 1' I get the above message and:

webserver.ohprs.org - fatal: Socket operation on non-socket

Any idea what this is? My host name is webserver and the local domain is ohprs.org. These are configured in my /etc/hosts file.

Wassup? I'm needing this real soon!
0
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 1500 total points
ID: 20463174
You should have a line in your /etc/inetd.conf something like in the box
ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  proftpd

Open in new window

0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 20463370
duncan roe: Yes, I've got exactly that. I'm thinking if I can fix the getaddrinfo error it might be OK. Any idea what the problem is on that?
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 20467133
Possibly proftpd was built for IPv6 but your kernel wan't(?)
It's odd though that you have that line in inetd.con yet you can't see the port listening. I wonder if this is a new inetd that uses a different config file? I would concentrate on resolving that for now.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 20467256
This is a straight slackware download from about 3 months ago. I did no building, vanilla, out of the box. I didn't even have to add drivers. I'll work on the addressing first and get back to this thread. Thanks
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 20470251
OK - I've added my linux host to the LMhosts file on the Server 2003. So now I can reference the host by name from there. However, this made no difference on proftpd. I've posted my proftpd.conf file below. I'll repeat the error messages here:

When I run proftpd -t (test config file) I get:
 - IPv6 getaddrinfo 'webserver.ohprs.org' error: Name or service not known

When I run 'proftpd -n -d 1' I get the above message and:

webserver.ohprs.org - fatal: Socket operation on non-socket

These messages don't tell me anything useful (to me). Does anyone know what they mean?

duncan_roe, inetd doesn't appear to have a version switch, but ident shows:
     $OpenBSD: inetd.c,v 1.79 2001/01/30 08:30:57 deraadt Exp $
     $Slackware: inetd.c 1.79s 2001/02/06 13:18:00 volkerdi Exp $
these don't look all that new. In fact they are the same as on the older Linix 2.4.29 where proftpd seems to run fine.

Below the proftpd.conf listing is the version/configuration of proftpd on the system that is NOT working: proftpd -V

ALL HELP GREATLY APPRECIATED!!!
# This is a basic ProFTPD configuration file.
# It establishes a single server and a single anonymous login.
# It assumes that you have a user/group "nobody" and "ftp"
# for normal/anonymous operation.
 
ServerName                      "ProFTPD Default Installation"
#ServerType                     standalone
ServerType                      inetd
DefaultServer                   on
 
# 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 that the server normally runs at.
#User                           nobody
#Group                          nogroup
User                            ftp
Group                           ftp
 
# This next option is required for NIS or NIS+ to work properly:
#PersistentPasswd off
 
SystemLog                       /var/log/proftpd.log
TransferLog                     /var/log/xferlog
 
# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite                on
</Directory>
 
# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from /etc/ftpusers.
<Anonymous ~ftp>
  RequireValidShell             off
  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                    50
 
  # 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>
 
  # An upload directory that allows storing files but not retrieving
  # or creating directories.
#  <Directory incoming/*>
#    <Limit READ>
#      DenyAll
#    </Limit>
#
#    <Limit STOR>
#      AllowAll
#    </Limit>
#  </Directory>
 
</Anonymous>
 
 
> proftpd -V
Compile-time Settings:
  Version: 1.3.0a
  Platform: LINUX
  Built With:
    configure --prefix=/usr --sysconfdir=/etc --enable-autoshadow --enable-ctrls --enable-ipv6 --localstatedir=/var/run --with-modules=mod_readme:mod_ratio:mod_tls:mod_wrap:mod_ctrls_admin i486-slackware-linux
 
  Files:
    Configuration File:
      /etc/proftpd.conf
    Pid File:
      /var/run/proftpd.pid
    Scoreboard File:
      /var/run/proftpd/proftpd.scoreboard
 
  Features:
    + Autoshadow support
    + Controls support
    + curses support
    - Developer support
    - DSO support
    + IPv6 support
    + Largefile support
    + ncurses support
    - POSIX ACL support
    + Shadow file support
    + Sendfile support
 
  Tunable Options:
    PR_TUNABLE_BUFFER_SIZE = 1024
    PR_TUNABLE_GLOBBING_MAX = 8
    PR_TUNABLE_HASH_TABLE_SIZE = 40
    PR_TUNABLE_NEW_POOL_SIZE = 512
    PR_TUNABLE_RCVBUFSZ = 87380
    PR_TUNABLE_SCOREBOARD_BUFFER_SIZE = 80
    PR_TUNABLE_SCOREBOARD_SCRUB_TIMER = 30
    PR_TUNABLE_SELECT_TIMEOUT = 30
    PR_TUNABLE_SNDBUFSZ = 16384
    PR_TUNABLE_TIMEOUTIDENT = 10
    PR_TUNABLE_TIMEOUTIDLE = 600
    PR_TUNABLE_TIMEOUTLINGER = 180
    PR_TUNABLE_TIMEOUTLOGIN = 300
    PR_TUNABLE_TIMEOUTNOXFER = 300
    PR_TUNABLE_TIMEOUTSTALLED = 3600
    PR_TUNABLE_XFER_BUFFER_SIZE = 16384
    PR_TUNABLE_XFER_SCOREBOARD_UPDATES = 10

Open in new window

0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 20470292
More information. I copied the proftpd version 1.2.10 from my older Linux system and replaced the 1.3.0a version on the newer Linux. This time proftpd -t worked. If I change the proftpd.conf file to specify standalone and run 'proftpd -n -d 1', that now works and I can ftp files. I can also now use inetd. There must be some funky build setting in the 1.3.0a version. I suppose I could research it, but the heck with that! I'll just run 1.2.10.
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 31412216
(in fact, maybe all I had to do was kill -HUP (inetd process)?!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question