{"id":2535,"date":"2020-07-04T13:00:00","date_gmt":"2020-07-04T12:00:00","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2535"},"modified":"2020-07-09T23:55:56","modified_gmt":"2020-07-09T22:55:56","slug":"fixing-ssh-keygen-unknown-option-g-or-t-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2535\/fixing-ssh-keygen-unknown-option-g-or-t-on-ubuntu-20-04\/","title":{"rendered":"Fixing ssh-keygen Unknown Option -G or -T on Ubuntu 20.04"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2537\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2535\/fixing-ssh-keygen-unknown-option-g-or-t-on-ubuntu-20-04\/sshkeygen_ubutuntu2004\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.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=\"sshkeygen_ubutuntu2004\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2537\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubutuntu2004.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This blog post talks about how you can resolve the problem &#8220;ssh-keygen Unknown Option -G&#8221; on Ubuntu 20.04.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">What is ssh-keygen -G and -T used for?<\/h2>\n\n\n\n<p>The command <code>ssh-keygen -G<\/code> was originally used to generate a list of prime numbers that could be used for key exchange. <\/p>\n\n\n\n<p>Typically the list of primes to use are pre-generated as it can take some time. By regenerating them you can increase the security of key exchange protocols marginally.<\/p>\n\n\n\n<p>Once the list or primes are generated you then need to screen them to check they are not inherently weak. To do this you would normally then call <code>ssh-keygen -T<\/code> on the list of generated primes to verify they were valid.<\/p>\n\n\n\n<p>Once done you will have a file which can be used to replace your <code>\/etc\/ssh\/moduli<\/code> file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The new way of generating Moduli instead of -G and -T<\/h2>\n\n\n\n<p>The latest version of OpenSSH which Ubuntu 20.04 comes bundled with has changed the commands. Previously you would run the following commands.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nssh-keygen -G moduli-2048.candidates -b 2048\nssh-keygen -T moduli-2048 -f moduli-2048.candidates\n<\/pre><\/div>\n\n\n<p>To achieve the same outcome with the new OpenSSH version you should use the following commands.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nssh-keygen -M generate -O bits=2048 moduli-2048.candidates\nssh-keygen -M screen -f moduli-2048.candidates moduli-2048\n<\/pre><\/div>\n\n\n<p>This will generate the same file as before which then can be used to replace your current <code>\/etc\/ssh\/moduli<\/code> file.<\/p>\n\n\n\n<p>This can be done with the following commands.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncp moduli-2048 \/etc\/ssh\/moduli\nrm moduli-2048\n<\/pre><\/div>\n\n\n<p>Once done SSH on your computer will be slightly more secure as you are using a new random set of prime numbers.<\/p>\n\n\n\n<p>If this worked for you or you have any questions post a comment below so I know if it works. Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post talks about how you can resolve the problem &#8220;ssh-keygen Unknown Option -G&#8221; on Ubuntu 20.04.<\/p>\n","protected":false},"author":1,"featured_media":2566,"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":"Today I talk about Fixing ssh-keygen Unknown Option -G or -T on #Ubuntu 20.04 #OpenSSH","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":[3],"tags":[13,39,388,147,389,390],"class_list":["post-2535","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fixes","tag-fix","tag-linux","tag-openssh","tag-ubuntu","tag-ubuntu-20-04","tag-ubuntu-20-04-server"],"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\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-ET","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2610,"url":"https:\/\/chewett.co.uk\/blog\/2610\/using-virtualbox-shared-folder-on-ubuntu-20-04\/","url_meta":{"origin":2535,"position":0},"title":"Using Virtualbox Shared Folder on Ubuntu 20.04","author":"Chewett","date":"September 12, 2020","format":false,"excerpt":"This post explains how you can configure Virtualbox Shared Folders for Ubuntu 20.04. Installing Virtualbox Guest Additions Before you can configure Virtualbox Shared folders you will need to install Virtualbox Guest Additions. I have detailed the process of installing this on another blogpost which you should first follow. Once done\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\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?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\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2541,"url":"https:\/\/chewett.co.uk\/blog\/2541\/install-virtualbox-guest-additions-on-ubuntu-20-04\/","url_meta":{"origin":2535,"position":1},"title":"Install Virtualbox Guest Additions on Ubuntu 20.04","author":"Chewett","date":"August 29, 2020","format":false,"excerpt":"This post describes how you can install Virtualbox Guest Additions on Ubuntu 20.04. Installing Virtualbox Guest Additions on Ubuntu 20.04 To install Virtualbox Guest Additions on Ubuntu 20.04 you will want to enable the multiverse repository. You can do this by running the following command. sudo add-apt-repository multiverse Once this\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\/08\/virtualbox_guest_additions_ubuntu_2004_posticon_OUTPUT.png?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\/08\/virtualbox_guest_additions_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_guest_additions_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_guest_additions_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_guest_additions_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1698,"url":"https:\/\/chewett.co.uk\/blog\/1698\/enabling-ssh-on-ubuntu-18-04\/","url_meta":{"origin":2535,"position":2},"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":[]},{"id":831,"url":"https:\/\/chewett.co.uk\/blog\/831\/enabling-ssh-ubuntu-16-04\/","url_meta":{"origin":2535,"position":3},"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":345,"url":"https:\/\/chewett.co.uk\/blog\/345\/ssh-access-passwordless-keyfile\/","url_meta":{"origin":2535,"position":4},"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":1197,"url":"https:\/\/chewett.co.uk\/blog\/1197\/removing-a-passphrase-from-a-ssh-key\/","url_meta":{"origin":2535,"position":5},"title":"Removing a passphrase from a SSH key","author":"Chewett","date":"May 23, 2018","format":false,"excerpt":"Here I explain how you can remove a passphrase from a SSH key. Why would you want to do this? 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\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\/05\/removing_passphrase_ssh.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\/05\/removing_passphrase_ssh.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_passphrase_ssh.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/05\/removing_passphrase_ssh.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2535","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=2535"}],"version-history":[{"count":4,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2535\/revisions"}],"predecessor-version":[{"id":2556,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2535\/revisions\/2556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2566"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}