{"id":1197,"date":"2018-05-23T13:00:30","date_gmt":"2018-05-23T13:00:30","guid":{"rendered":"http:\/\/chewett.co.uk\/blog\/?p=1197"},"modified":"2018-05-26T14:35:24","modified_gmt":"2018-05-26T13:35:24","slug":"removing-a-passphrase-from-a-ssh-key","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/1197\/removing-a-passphrase-from-a-ssh-key\/","title":{"rendered":"Removing a passphrase from a SSH key"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1210\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/1197\/removing-a-passphrase-from-a-ssh-key\/removing_ssh_passphrase\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"removing_ssh_passphrase\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?fit=678%2C254&amp;ssl=1\" class=\"aligncenter size-full wp-image-1210\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?resize=678%2C254\" alt=\"\" width=\"678\" height=\"254\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_ssh_passphrase.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p>Here I explain how you can remove a passphrase from a SSH key.<\/p>\n<p><!--more--><\/p>\n<h2>Why would you want to do this?<\/h2>\n<p>There may be cases where you have deployed a SSH\u00a0key with a passphrase but now want to use it in a script. While you can add the key to the currently running SSH agent it may be easier to have a copy of the key without the passphrase.<\/p>\n<p>Since the passphrase just allows the use of the key, removing it won&#8217;t affect the public key of the associated private key. This means we can easily remove the passphrase and still have it usable in the same way as before with the phrase.<\/p>\n<h2>Removing the passphrase from a SSH key<\/h2>\n<p>Before starting this it is recommended to backup your SSH key.<\/p>\n<p>To start the process of removing a passphrase from a SSH key type:<\/p>\n<pre><code>ssh-keygen -p<\/code><\/pre>\n<p>Once this has started you will be asked where the SSH key exists. Once you have given this information it will ask for the current passphrase and a new passphrase to set.<\/p>\n<p>We can remove the passphrase from the SSH key by not setting the passphrase when asked. By doing this we will have removed the passphrase from the key.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here I explain how you can remove a passphrase from a SSH key.<\/p>\n","protected":false},"author":1,"featured_media":1209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"How to remove a passphrase from a #SSH key","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[39,90],"class_list":["post-1197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informational","tag-linux","tag-ssh"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_passphrase_ssh.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-jj","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":345,"url":"https:\/\/chewett.co.uk\/blog\/345\/ssh-access-passwordless-keyfile\/","url_meta":{"origin":1197,"position":0},"title":"SSH access with passwordless keyfile","author":"Chewett","date":"May 27, 2017","format":false,"excerpt":"I want to be able to access my Raspberry Pi Cluster and log onto any node without entering a password. To do this I can set up as passwordless SSH key. Generating a SSH Key To generate a SSH key you can use the command ssh-keygen. Once you have ran\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":831,"url":"https:\/\/chewett.co.uk\/blog\/831\/enabling-ssh-ubuntu-16-04\/","url_meta":{"origin":1197,"position":1},"title":"Enabling SSH on Ubuntu 16.04","author":"Chewett","date":"November 8, 2017","format":false,"excerpt":"By default you are not able to SSH into an Ubuntu 16.04\u00a0 machine and this blog post describes the steps needed to install SSH server. Installing OpenSSH Server To enable logging in from another computer via SSH you need to install a SSH\u00a0server. To do this you\u00a0can run the following\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/enable_ssh_on_ubuntu.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/enable_ssh_on_ubuntu.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/enable_ssh_on_ubuntu.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/enable_ssh_on_ubuntu.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2535,"url":"https:\/\/chewett.co.uk\/blog\/2535\/fixing-ssh-keygen-unknown-option-g-or-t-on-ubuntu-20-04\/","url_meta":{"origin":1197,"position":2},"title":"Fixing ssh-keygen Unknown Option -G or -T on Ubuntu 20.04","author":"Chewett","date":"July 4, 2020","format":false,"excerpt":"This blog post talks about how you can resolve the problem \"ssh-keygen Unknown Option -G\" on Ubuntu 20.04. What is ssh-keygen -G and -T used for? The command ssh-keygen -G was originally used to generate a list of prime numbers that could be used for key exchange. Typically the list\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":194,"url":"https:\/\/chewett.co.uk\/blog\/194\/mysql-workbench-working-with-key-based-exchange-mechanisms\/","url_meta":{"origin":1197,"position":3},"title":"Mysql workbench working with key based exchange mechanisms","author":"Chewett","date":"June 3, 2015","format":false,"excerpt":"It appears newer linux sshd configs\u00a0(fedora 22) by default include a smaller set of key exchange based mechanisms that they have turned on. This means that it gives errors saying it is unable to connect to the server. To fix this you need to enable some of the older key\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2399,"url":"https:\/\/chewett.co.uk\/blog\/2399\/starting-a-ssh-agent-with-cygwin\/","url_meta":{"origin":1197,"position":4},"title":"Starting a SSH Agent with Cygwin","author":"Chewett","date":"February 1, 2020","format":false,"excerpt":"This post includes a quick snippet to start a SSH agent using Cygwin under Windows. Starting a SSH Agent The command to start a SSH agent is ssh-agent. However just running this wont set up your terminal to use it properly. To properly set up your SSH agent and configure\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/02\/ssh_agent_cygwin_posticon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/02\/ssh_agent_cygwin_posticon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/02\/ssh_agent_cygwin_posticon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/02\/ssh_agent_cygwin_posticon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1698,"url":"https:\/\/chewett.co.uk\/blog\/1698\/enabling-ssh-on-ubuntu-18-04\/","url_meta":{"origin":1197,"position":5},"title":"Enabling SSH on Ubuntu 18.04","author":"Chewett","date":"November 14, 2018","format":false,"excerpt":"By default Ubuntu 18.04 doesn't enable SSH, this post describes the steps you need to set up SSH. Enabling SSH on Ubuntu 18.04 Since many people will not require a SSH daemon on their computer this is not enabled by default. This means if you want to SSH into your\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=1197"}],"version-history":[{"count":3,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1197\/revisions"}],"predecessor-version":[{"id":1211,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1197\/revisions\/1211"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/1209"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=1197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=1197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=1197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}