4

I use Putty to connect to ssh server when on windows, and the ssh command when on linux. I've recently noticed, that Putty establishes the connection much more quickly compared to the ssh and scp commands on linux. While It only takes a second or less to login via putty, it takes about 20 secons to get to the password prompt in ssh when connection to the same server from the same network.

I'm using the default settings in Putty. I also don't use any special arguments with the ssh command (just the port, username, and server name). Is there any way I can make ssh connect as quickly as Putty does?

2

This is what i came up with, by guessing... It is not sure it'll work:

ssh -4 -C -o PreferredAuthentications=password   user@host.domain.com

Where:

  • -4 force IPv4, disable IPv6 tries.
  • -C enable connection compression.
  • -o PreferredAuthentications=password tries nothing else but password auth.

I think that just the first or last option should do the trick. The -C have little effect in your case.

You may want to setup a authentication by rsa key. I've written a how-to to Harden the SSH access security on Debian. It may be of help to you.

  • WOW! major improvement, as you said, -k and -C have negligible effect since it's just the initial handshake that's taking forever. Though, -C could help with scp. -k I don't really understand. Anyway, thanks a lot! – Anthony Feb 1 '14 at 17:43
  • you're right, the -k is useless. i've edited my answer. – Biapy Feb 1 '14 at 18:27
  • By the way I'm also adding the -2 switch whitch stands for ssh 2, to avoid negociation overhead, though I think it's useless too because I probably starts with version 2 and falls back to 1 if not supported, but it costs only on keystroke to add that swith ( -42 instead of just 4). – Anthony Feb 1 '14 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.