Link to home
Start Free TrialLog in
Avatar of codenamecharlie
codenamecharlie

asked on

telnet/ftp is slow


I use Debian as Linux server and I run ftpd on it.

Then from Windows machine I telnet or ftp to this debian server,
everytime when I logon, it is always slow, takes about 1 minute before
it prompts me to input username and password.

Also, when I put/get files thru ftp, seems it is slow.

I guess something is wrong with the configuration?
Or maybe Linux does this intentionally for security reasons?

Anybody helps me? thanks
Avatar of noonday
noonday

Check the DNS configuration on the Linux server.
ftping on any account or a specific account?
anonymous?
A useful way to diagnose this is to monitor what's happening remotely via ethereal (i.e.
logging in may be causing nfs mounts, which may time out or something else surprising).

If it is slow to connect through telnet and it seems ok once you get connected, that's typically something wrong with DNS configuration. Just saw you also mentioned the get/put also seems slow after gets connected, you may want to investigate the more on network side.
I agree with noonday

also please check

a) the wire. both from client to hub/switch, and the one from linux to hub/switch it should be a CAT5 wire.
b) the lan card. if it is failing it will throw many irq and other problems to the /var/log /messages or /var/log/syslog logs
c) the speed. just check if your card is 100mbits or 10mbits. with a simple ifconfig you should be able to see.
Hi,

Whats the FTP deamon you are using? also I would suggest removing the telnet deamon and replacing it
with the ssh deamon, the reason for this is because telnet is insecure.
Also check to see that you not mixing duplexing between the switch/hub and both machines.  I've seen exactly what you're describing before.  This day and age everything should be full duplex, on linux you can probably use either mii-tool or mii-diag to see what duplex you're using.
well... full duplex can only be used if you are using switches. hubs simply doesn't support it.

but if you can, as sheetbird says, go full duplex. not having it, it's like having a car but keep using a bicicle instead =)
the debian machine doesn't know the hostname of your windows machine and is trying to look it up in DNS.  If you put the windows machine name
in the debian machine's /etc/hosts file, like this:

192.168.1.100     windowsmachinename

then the one-minute lag after logging in should stop.

You can find out the windows hostname by opening a dos command box and typing
ipconfig /all
and look for the hostname line.
Avatar of codenamecharlie

ASKER


Thanks for your comments. Maybe I did not explain the problem clearly. Okay, here we go.  
My debian machine is 192.168.1.100 and my Windows XP machine is 192.168.1.200,
subnet mask is 255.255.255.0, so they are in the same subnet, I think there is no need
for DNS or Gateway, right?  Below is what happened when I tried to telnet to Debian machine
from my Windows XP machine:

$ telnet 192.168.1.100 -l jsmith
Trying 192.168.1.100...
Connected to 192.168.1.100.
Escape character is '^]'.
-----------HERE, IT WAITED for 20 seconds before promts for password----------
Password: ******
Last login: Mon Apr  3 04:56:33 2006 from 192.168.1.200 on pts/0
Linux debian.home.com 2.4.27-2-386 #1 Mon May 16 16:47:51 JST 2005 i686 GNU/Linu

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
jsmith@debian:~$

What puzzles me is that why it waited for so long (20 seconds) before prompting
for password??? The debian "deb file" I used to install this telnet daemon is
telnetd_0.17-29_i386.deb which I downloaded from http://packages.debian.org/stable/net/telnetd
BTW, forgot to mention, these two machines are just my home PCs
and they are just connected thru a hub, very simple & straightforward,
no complicated networking here.

-codenamecharlie
The debian machine waited so long because it was trying to find the name of the machine you were logging into.  After a timeout period it gives up and lets you log in.  Doesn't matter if the machines are on the same subnet or not - that's irrelevant to name lookup.  You see the line

Last login: Mon Apr  3 04:56:33 2006 from 192.168.1.200 on pts/0

that 192.168.1.200 would normally have the DNS name of your windows machine.  Try what I told you and see if that doesn't make the lag go away.
ASKER CERTIFIED SOLUTION
Avatar of kiffney
kiffney

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Problem is correctly described by kiffney. teknet daemon is allowing you to login only *after* the timeout trying to resolve your ip address to a domain name.

solution can be a little more tricky, in my experience.

this is becase *maybe* you have your debian to resolve first using dns, and if timeout, then hosts file.

if you want to change this, edit the file /etc/host.conf to have something like
multi on
order hosts,bind

so you know telnetd will try to reslv first using hosts, and only if t fails, try bind (dns system)

if you have that, then you should do what kiffney wrote in his previous post
Great, I did what kiffney told me to do, and it worked!

Just add one line in /etc/hosts, that's it!

Also thanks other guys who posted comments.