{"id":136,"date":"2013-06-06T11:22:38","date_gmt":"2013-06-06T09:22:38","guid":{"rendered":"http:\/\/www.lehtosaari.fi\/?p=136"},"modified":"2013-06-06T11:22:38","modified_gmt":"2013-06-06T09:22:38","slug":"ssh-key-handling-on-multiple-servers-environment","status":"publish","type":"post","link":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/","title":{"rendered":"SSH Key handling on multiple servers environment"},"content":{"rendered":"<p>To have fluent access to securely walk through you servers, I have collected here some helpful instructions. I&#8217;m not going to go too detailed and the simplest things but some that I have found useful.<\/p>\n<p>First of the tools, on linux and other unix machines and mac, I use the basic OpenSSH tools that there are, so ssh, scp, ssh-keygen and so on. On Windows I use <a title=\"putty\" href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">putty<\/a> family tools + some extra tools like Connection Managers.<\/p>\n<p>So first create keys like one with passphrase and one without:<\/p>\n<pre>ssh-keygen -t rsa -b 4096<\/pre>\n<p>Then I rename them some way like adding userid on the name and ppk extension for the private file to make it easier to handle in Windows machines. I also modify the comment string to have something useful there.<\/p>\n<p>On Windows you can use puttygen.exe for the same.<\/p>\n<p>Then of course make sure your private key is only as few places as possible and in trusted places. I keep mine only on my trusted personal devices.<\/p>\n<p>Then with the following command I copied the files to servers where I need them.<\/p>\n<pre>cat ~\/.ssh\/id_rsa_some.pub | ssh userid@servername.fi \"cat &gt;&gt; ~\/.ssh\/authorized_keys\"<\/pre>\n<p>Now if you need to log on to many machines loops, you can do that with Agent forwarding. In ssh you can simply do this with -A switch, and in Putty you can enable that on the profiles with Connection &#8211; SSH &#8211; Auth &#8211; Allow agent forwarding.<\/p>\n<p>After that you have on your favorite laptop or desktop private file once, and there you will use eg. in Windows pageant to load that key by giving password for authentication only once. Then you will have the agent program running and with those Agent forwarding enabled, you will get the authentication to all your machines.<\/p>\n<p>There is some security considerations here to take in account so you should consider that also when doing this.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To have fluent access to securely walk through you servers, I have collected here some helpful instructions. I&#8217;m not going to go too detailed and the simplest things but some that I have found useful. First of the tools, on linux and other unix machines and mac, I use the basic OpenSSH tools that there &hellip; <a href=\"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SSH Key handling on multiple servers environment&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[13,2,3,17],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-crypto","category-ict","category-linux","category-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SSH Key handling on multiple servers environment - V-P:s blog<\/title>\n<meta name=\"description\" content=\"SSH Key handling on multiple servers environment\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SSH Key handling on multiple servers environment - V-P:s blog\" \/>\n<meta property=\"og:description\" content=\"SSH Key handling on multiple servers environment\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/\" \/>\n<meta property=\"og:site_name\" content=\"V-P:s blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/velipekka.lehtosaari\" \/>\n<meta property=\"article:published_time\" content=\"2013-06-06T09:22:38+00:00\" \/>\n<meta name=\"author\" content=\"Veli-Pekka Lehtosaari\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Veli-Pekka Lehtosaari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/\"},\"author\":{\"name\":\"Veli-Pekka Lehtosaari\",\"@id\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/#\\\/schema\\\/person\\\/611e219337ca0640ca4d1a4f104789d6\"},\"headline\":\"SSH Key handling on multiple servers environment\",\"datePublished\":\"2013-06-06T09:22:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/\"},\"wordCount\":311,\"commentCount\":2,\"articleSection\":[\"Crypto\",\"ICT\",\"Linux\",\"Windows\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/\",\"url\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/\",\"name\":\"SSH Key handling on multiple servers environment - V-P:s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/#website\"},\"datePublished\":\"2013-06-06T09:22:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/#\\\/schema\\\/person\\\/611e219337ca0640ca4d1a4f104789d6\"},\"description\":\"SSH Key handling on multiple servers environment\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/2013\\\/06\\\/06\\\/ssh-key-handling-on-multiple-servers-environment\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSH Key handling on multiple servers environment\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/#website\",\"url\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/\",\"name\":\"V-P:s blog\",\"description\":\"Mostly technical blogging\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/#\\\/schema\\\/person\\\/611e219337ca0640ca4d1a4f104789d6\",\"name\":\"Veli-Pekka Lehtosaari\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8be37ee011bb9b852079d892b708e7cf24482def2e72946e8d44fac4ff97efe2?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8be37ee011bb9b852079d892b708e7cf24482def2e72946e8d44fac4ff97efe2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8be37ee011bb9b852079d892b708e7cf24482def2e72946e8d44fac4ff97efe2?s=96&d=mm&r=g\",\"caption\":\"Veli-Pekka Lehtosaari\"},\"description\":\"Veli-Pekka Lehtosaari, most call me VP, age 52 (2025), CEO, Consult, M.Sc.(Tech), Electronics, ICT 1997, Single, 2 children (Girls), Hobbies: ICT, Motor Sports, Snowboarding, Politics.\",\"sameAs\":[\"http:\\\/\\\/www.lehtosaari.fi\",\"https:\\\/\\\/www.facebook.com\\\/velipekka.lehtosaari\",\"https:\\\/\\\/www.instagram.com\\\/vplehto\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/veli-pekka-lehtosaari-88a00521\\\/\",\"https:\\\/\\\/x.com\\\/vplehto\",\"https:\\\/\\\/www.youtube.com\\\/vplehto\"],\"url\":\"http:\\\/\\\/www.lehtosaari.fi\\\/lehtosaari\\\/veli-pekka\\\/author\\\/vplehto\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SSH Key handling on multiple servers environment - V-P:s blog","description":"SSH Key handling on multiple servers environment","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/","og_locale":"en_US","og_type":"article","og_title":"SSH Key handling on multiple servers environment - V-P:s blog","og_description":"SSH Key handling on multiple servers environment","og_url":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/","og_site_name":"V-P:s blog","article_author":"https:\/\/www.facebook.com\/velipekka.lehtosaari","article_published_time":"2013-06-06T09:22:38+00:00","author":"Veli-Pekka Lehtosaari","twitter_misc":{"Written by":"Veli-Pekka Lehtosaari","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/#article","isPartOf":{"@id":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/"},"author":{"name":"Veli-Pekka Lehtosaari","@id":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/#\/schema\/person\/611e219337ca0640ca4d1a4f104789d6"},"headline":"SSH Key handling on multiple servers environment","datePublished":"2013-06-06T09:22:38+00:00","mainEntityOfPage":{"@id":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/"},"wordCount":311,"commentCount":2,"articleSection":["Crypto","ICT","Linux","Windows"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/","url":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/","name":"SSH Key handling on multiple servers environment - V-P:s blog","isPartOf":{"@id":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/#website"},"datePublished":"2013-06-06T09:22:38+00:00","author":{"@id":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/#\/schema\/person\/611e219337ca0640ca4d1a4f104789d6"},"description":"SSH Key handling on multiple servers environment","breadcrumb":{"@id":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/2013\/06\/06\/ssh-key-handling-on-multiple-servers-environment\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/"},{"@type":"ListItem","position":2,"name":"SSH Key handling on multiple servers environment"}]},{"@type":"WebSite","@id":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/#website","url":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/","name":"V-P:s blog","description":"Mostly technical blogging","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/#\/schema\/person\/611e219337ca0640ca4d1a4f104789d6","name":"Veli-Pekka Lehtosaari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8be37ee011bb9b852079d892b708e7cf24482def2e72946e8d44fac4ff97efe2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8be37ee011bb9b852079d892b708e7cf24482def2e72946e8d44fac4ff97efe2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8be37ee011bb9b852079d892b708e7cf24482def2e72946e8d44fac4ff97efe2?s=96&d=mm&r=g","caption":"Veli-Pekka Lehtosaari"},"description":"Veli-Pekka Lehtosaari, most call me VP, age 52 (2025), CEO, Consult, M.Sc.(Tech), Electronics, ICT 1997, Single, 2 children (Girls), Hobbies: ICT, Motor Sports, Snowboarding, Politics.","sameAs":["http:\/\/www.lehtosaari.fi","https:\/\/www.facebook.com\/velipekka.lehtosaari","https:\/\/www.instagram.com\/vplehto\/","https:\/\/www.linkedin.com\/in\/veli-pekka-lehtosaari-88a00521\/","https:\/\/x.com\/vplehto","https:\/\/www.youtube.com\/vplehto"],"url":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/author\/vplehto\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":0,"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lehtosaari.fi\/lehtosaari\/veli-pekka\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}