LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Slow ssh connection (https://www.linuxquestions.org/questions/linux-server-73/slow-ssh-connection-936825/)

angelo.c 03-28-2012 02:14 AM

Slow ssh connection
 
Hello,everyone!:cool:

I open the ssh connection from my server and I constantly experience slow connection from my end to the server.When I typed some command in the putty console, the character seems like lagging for a few seconds and appeared.

My server loading is light and I don't know what is the cause.Is it that the server is behind my router?

Please drop me a line if you have any ideas.

deep27ak 03-28-2012 04:08 AM

If the connection is taking too much time to take session then it means the network is slow and after getting a ssh connection if you are facing trouble it means the machine you are trying to connect is having performance issues.

so check the performance of the client machine you are trying to connect if you get the same problem while working directly on it.

chrism01 03-28-2012 08:07 PM

You could try the traceroute cmd http://linux.die.net/man/8/traceroute to get some actual figures.
Simple example
Code:

traceroute ip.of.the.server

MattSong 03-30-2012 02:57 AM

check if you have nameserver set, ssh need Reverse resolution, when you dont have nameserver aviliable, it will take a long time to wait for timeout.

jschiwal 03-30-2012 03:25 AM

Can you ssh into the server on the same LAN as the server?

Try "ssh -C user@server". If that speeds things up, that could indicate a slow network connection.
If you used "ssh -X user@server", there may be a problem with there not being a dbus session.

If the problem is with a second ssh session, here is how you can use the same tunnel for multiple sessions:
create a ~/.ssh/config file with these contents:
Code:

Host *
        ControlMaster auto
        ControlPath ~/.ssh/control-master/%r@%h:%p

Create the control-master directory:
mkdir ~/.ssh/control-master

This will speed up making new connections.

Since you are going through a router (from outside the server's network I presume), the problem could be due to buffer bloat.
http://www.coverfire.com/archives/20...y-experiments/

angelo.c 03-30-2012 04:57 AM

Thanks everyone!Those information are very useful.

Actually,my traceroute is about 12 hops. I guess it shouldn't be a problem.

This issue is not going to happen if I am at home (in LAN).

jschiwal,I'm going to look at your website to see whether this is the problem.

Thanks all for helping out.


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