LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   slackware ftp connection refused (https://www.linuxquestions.org/questions/linux-networking-3/slackware-ftp-connection-refused-933421/)

ofilha 03-08-2012 07:59 AM

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.

bathory 03-08-2012 10:50 AM

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

ofilha 03-08-2012 11:06 AM

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.

ofilha 03-08-2012 08:08 PM

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.

bathory 03-09-2012 12:39 AM

Quote:

Originally Posted by ofilha (Post 4622352)
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

ofilha 03-09-2012 07:59 AM

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

bathory 03-09-2012 09:23 AM

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

ofilha 03-09-2012 11:03 AM

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.


All times are GMT -5. The time now is 12:54 PM.