{"id":195,"date":"2015-04-27T13:28:31","date_gmt":"2015-04-27T13:28:31","guid":{"rendered":"http:\/\/betakb.veeble.org\/?p=195"},"modified":"2025-04-21T15:46:31","modified_gmt":"2025-04-21T10:16:31","slug":"speed-up-ssh-login","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/speed-up-ssh-login\/","title":{"rendered":"Speed-up SSH Login"},"content":{"rendered":"\n<p>1. You may have to wait a long time to access your server via ssh. To have faster <a href=\"https:\/\/www.cloudflare.com\/learning\/access-management\/what-is-ssh\/\" target=\"_blank\" rel=\"noopener\">ssh<\/a> logins you may try the following: The most often suggested fix is to add the following to your server configuration (sshd_config):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> UseDNS no \n<\/pre>\n\n\n\n<p>This prevents the SSH server from making a reverse DNS lookup \u2013 that is, looking up the IP address and finding what DNS name is associated with that IP. Since the reverse lookup often does not respond, then there is a time-out involved and this is what generates the normal delay seen in SSH connections.<\/p>\n\n\n\n<p>2. Open sshd_config and comment the all GSSAPI and Kerberos options as these two authentication procedures take a long time to provide ssh logins.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># GSSAPI options\n#GSSAPIAuthentication no\n#GSSAPIAuthentication yes\n#GSSAPICleanupCredentials yes\n#GSSAPICleanupCredentials yes\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># Kerberos options\n#KerberosAuthentication no\n#KerberosOrLocalPasswd yes\n#KerberosTicketCleanup yes\n#KerberosGetAFSToken no\n<\/pre>\n\n\n\n<p>3. You can make all sessions to the same host use a single connection, which will greatly speed up subsequent logins, by adding these lines under the proper host in \/etc\/ssh\/ssh_config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ControlMaster auto\nControlPath ~\/.ssh\/socket-%r@%h:%p\n<\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"changing-ciphers-by-ssh\">Changing Ciphers by ssh<\/h3>\n\n\n<p>4. Changing the ciphers used by SSH to less CPU-demanding ones can improve speed. In this aspect, the best choices are Arcfour and blowfish-cbc. Please do not do this unless you know what you are doing; Arcfour has a number of known weaknesses. To use them, run SSH with the &#8220;c&#8221; flag, like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ ssh -c arcfour,blowfish-cbc user@server-address\n<\/pre>\n\n\n\n<p>To use them permanently, add this line under the proper host in \/etc\/ssh\/ssh_config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Ciphers arcfour,blowfish-cbc\n<\/pre>\n\n\n\n<p>5. Another option to improve speed is to enable compression with the &#8220;C&#8221; flag. A permanent solution is to add this line under the proper host in \/etc\/ssh\/ssh_config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Compression yes\n<\/pre>\n\n\n\n<p>6. Login time can be shortened by using the &#8220;4&#8221; flag, which bypasses IPv6 lookup. This can be made permanent by adding this line under the proper host in \/etc\/ssh\/ssh_config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">AddressFamily inet\n<\/pre>\n\n\n\n<p>7. Another way of making these changes permanent is to create an alias in ~\/.bashrc:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">alias ssh='ssh -C4c arcfour,blowfish-cbc' \n<\/pre>\n\n\n\n<p>8. You may also enable password-less login or login using the authentication keys, as mentioned <a class=\"external text\" href=\"http:\/\/kb.veeble.org\/SSH_login_without_password\" rel=\"nofollow noopener\" target=\"_blank\">here<\/a><\/p>\n\n\n\n<p>After making changes in the SSH configuration, restart the service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service sshd restart<\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-16120fff wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Unleash Your Website&#8217;s Potential<\/h3><p class=\"uagb-cta__desc\">Experience lightning-fast speeds and unparalleled performance with our powerful VPS hosting solutions.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/vps-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">See Pricing<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. You may have to wait a long time to access your server via ssh. To have faster ssh logins you may try the [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":7780,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"class_list":["post-195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Speed-up-SSH-Login.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Vipin Raj","author_link":"https:\/\/www.veeble.com\/kb\/author\/vipin\/"},"uagb_comment_info":0,"uagb_excerpt":"1. You may have to wait a long time to access your server via ssh. To have faster ssh logins you may try the [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=195"}],"version-history":[{"count":4,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":8645,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/195\/revisions\/8645"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/7780"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}