slow ssh under ubuntu fix

Oh, the grinding and gnashing of teeth! My ssh to various boxes was redonkulously slow… I finally realized… it was just me… or rather just my ubuntu… or actually… just the ssh_config for my ubuntu…

Thanks to ssh -v, I saw:

debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

which made me say: wtf is gssapi-with-mic? After some digging, I found this crap in /etc/ssh/ssh_config:

GSSAPIAuthentication yes

I changed it to

GSSAPIAuthentication no

check the difference:

% time ssh some_host echo GSSAPIAuthentication yes
GSSAPIAuthentication yes
real    0m15.398s
user    0m0.028s
sys     0m0.004s
% time ssh some_host echo GSSAPIAuthentication no
GSSAPIAuthentication no
real    0m0.364s
user    0m0.028s
sys     0m0.008s

The math sez it’s about 42x faster with that dumb junk turned off!

>.<

Advertisements

10 Comments »

  1. Boababa said

    Hey, just wanted to say thanks for the post. I spent 2 days beating my head against the @$$ slow ssh on a lab machine, then found your post and got the sysadmin to mod the config. My sanity is now returning. Thank you!

  2. camypaj said

    thanks a lot! 🙂 this has been bugging me for a long time

  3. ruien said

    Awesome, thanks for the post!

  4. Mark said

    Thanks for this post. Ubuntu rocks, but sometimes they try and be too clever for their own good! 😛

  5. 10kbooks said

    glad to find your post. Solved my problem. Thanks.

  6. leo said

    Ow

    thanks.

  7. Harshit Sureka said

    Thanks, Helped me a lot. Are you sure there are no consequences of this?

  8. brianin3d said

    LOL. To be honest with you, I have no idea if there are any consequences or not. Probably not…

  9. deyb said

    thanks!

  10. Mike said

    Hey .. for me it did not work but this did:

    # sudo echo “UseDNS no” >> /etc/ssh/sshd_config
    # sudo restart ssh

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: