LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2012, 07:59 AM   #1
ofilha
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Rep: Reputation: 0
slackware ftp connection refused


I have looked at the posts about this issue and i had it before and had revolved. This time nothing works.
When i try ftp from a windows machine to my slackware laptop,the server, i get a connection refused.
In the slackware laptop, if i ftp to localhost, i am able to login, if i ftp to the hostname or the ip address it times out.

I have proftp as the ftp in my inetd.conf file.

A few times, my laptop shutdown improperly because i do not have a battery and the plug came off. Maybe something got whacked.

I also ran nmap and received the following:
bash-4.1# nmap -PN homepc1

Starting Nmap 5.21 ( http://nmap.org ) at 2012-03-08 05:56 PST
Nmap done: 1 IP address (0 hosts up) scanned in 0.41 seconds
bash-4.1#

But nmap on localhost shows that localhost is fine:

Starting Nmap 5.21 ( http://nmap.org ) at 2012-03-08 05:55 PST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000080s latency).
Not shown: 985 closed ports
PORT STATE SERVICE
21/tcp open ftp


Any suggestions?

Thank you.

Last edited by ofilha; 03-08-2012 at 08:17 AM. Reason: follow up.
 
Old 03-08-2012, 10:50 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

There should be a firewall running that denies access to your box port 21.
Or (most unlikely) the ftp server is listening only on the local loopback interface. Run
Code:
netstat -talp|grep ftp
to see if that's the case

Regards
 
Old 03-08-2012, 11:06 AM   #3
ofilha
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
slackware ftp connection refused

Thank your.
I am at work now and cannot try your suggestion. I will give it a try later on.

The weird thing is that a couple of months ago i was able to ftp from my windows machine to the linux machine. The only change was that a couple of times my laptop was disconnected by accident and i have no battery. When i rebooted it had to rebuild all the inodes.

When i do a ps -e | grep '*ftp*' it does not find anything.

Thanks for the info.
 
Old 03-08-2012, 08:08 PM   #4
ofilha
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
when i run netstat -talp | grep ftp i get a different pid for inetd than what i see in the file inetd.pid. I am assuming that the number next to inetd in the output of the netstat command is the pid of inetd, i see a 1667/inetd but it shows that it is listening.
 
Old 03-09-2012, 12:39 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by ofilha View Post
when i run netstat -talp | grep ftp i get a different pid for inetd than what i see in the file inetd.pid. I am assuming that the number next to inetd in the output of the netstat command is the pid of inetd, i see a 1667/inetd but it shows that it is listening.
So you're running proftpd through inetd. Could you post the output of the netstat command?
If /var/run/inetd.pid is different than 1667 something is wrong, so restart inetd to keep them in sync.
Also check /etc/hosts.allow and /etc/hosts.deny to see if you deny access from outside through tcpwrappers

Last edited by bathory; 03-09-2012 at 12:54 AM. Reason: add info
 
Old 03-09-2012, 07:59 AM   #6
ofilha
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Thank you.
When check the hosts.allow,deny and equiv only equiv has a hostname: localhost the other have no hostnames in them.
I finally did synchronize the pid of inetd.pid with inetdp. One thing i had noticed was that there were two inetd services runnning and netstat was only picking up the one that was different from inetd.pid file. The pid with the same number was from /usr/sbin/inetd the other did not show a path. I killed the one that was different. After all this i still am not able to connect from my windows machine, still getting connection refused.

Here is the output you had asked after i removed one of inetd services, the one that did not match the inetd.pid file

bash-4.1$ cat /var/run/inetd.pid
1666
bash-4.1$ ps -ef | grep inetd
root 1666 1 0 05:26 ? 00:00:00 /usr/sbin/inetd
joao 2255 2161 0 05:34 pts/2 00:00:00 grep inetd
bash-4.1$ netstat -talp | grep inetd
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)

bash-4.1$
bash-4.1$ su root
Password:
bash-4.1# netstat -talp | grep inetd
tcp 0 0 *:login *:* LISTEN 1666/inetd
tcp 0 0 *:smpnameres *:* LISTEN 1666/inetd
tcp 0 0 *:time *:* LISTEN 1666/inetd
tcp 0 0 *:finger *:* LISTEN 1666/inetd
tcp 0 0 *:auth *:* LISTEN 1666/inetd
tcp 0 0 *:ftp *:* LISTEN 1666/inetd
tcp 0 0 *:telnet *:* LISTEN 1666/inetd
 
Old 03-09-2012, 09:23 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
One thing i had noticed was that there were two inetd services runnning and netstat was only picking up the one that was different from inetd.pid file. The pid with the same number was from /usr/sbin/inetd the other did not show a path. I killed the one that was different. After all this i still am not able to connect from my windows machine, still getting connection refused.
This look weird. Let's hope that someone started another instance of inetd by mistake or else I'm afraid to say so, but I think you have may more serious problems here.
I would suggest you to boot your box with a live-CD containing some security auditing tools and check the integrity of your data.
Quote:
bash-4.1# netstat -talp | grep inetd
tcp 0 0 *:login *:* LISTEN 1666/inetd
tcp 0 0 *:smpnameres *:* LISTEN 1666/inetd
tcp 0 0 *:time *:* LISTEN 1666/inetd
tcp 0 0 *:finger *:* LISTEN 1666/inetd
tcp 0 0 *:auth *:* LISTEN 1666/inetd
tcp 0 0 *:ftp *:* LISTEN 1666/inetd
tcp 0 0 *:telnet *:* LISTEN 1666/inetd
BTW you don't need most of these services (like finger, time, telnet etc are well known to be insecure), so comment out the respective lines from /etc/inetd.conf
 
Old 03-09-2012, 11:03 AM   #8
ofilha
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks,
I will comment those out. Since i just use this system for fun, i may just reinstall the operating system or actually try out Ubuntu. I have been using slackware since i don't know when but i noticed ubuntu has a ton of languages that slackware does not.
Thank you so much for all the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] FTP connection refused Perrorist Linux - Server 3 10-13-2009 06:11 PM
ftp connection refused sunils1973 Linux - Networking 2 07-22-2009 01:54 AM
ftp:// CONNECTION REFUSED _ AsiF Linux - Networking 6 06-30-2007 08:24 AM
connection refused on FTP jsheffie SUSE / openSUSE 2 07-07-2005 12:35 PM
ftp - connection refused aje Linux - Networking 4 11-06-2004 05:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration