. I won’t walk through each step since this part varies from OS to OS – the rest of the steps are identical however.<\/span><\/p>\n\n\n\n$ sudo apt-get install libpam-google-authenticator\n\u2026<\/pre>\n\n\n\n2 – Restart the ssh service<\/p>\n\n\n\n
$ sudo restart ssh<\/pre>\n\n\n\n3 – Run the google-authenticator command to generate a secret key for your account which you’ll store in your phone. This information will be stored in a configuration file that we’re going to get into later. I don’t need to comment that you actually have to enter the secret key into your phone, do I?<\/span><\/p>\n\n\n\n$ google-authenticator\nYour new secret key is: HZGVGLVG2ES4N5DW\nYour verification code is 352297\nYour emergency scratch codes are:\n45850250\n14934076\n63800816\n93689045\n82870703<\/pre>\n\n\n\n4 – Give it a spin. From another shell go ahead and try it out.<\/p>\n\n\n\n
$ssh topher@192.168.56.101\nPassword:\nVerification code:\nWelcome to Ubuntu 12.04.3 LTS (GNU\/Linux 3.8.0-29-generic i686)<\/pre>\n\n\n\n5 – Let’s take a look at the configuration file. We’re going to copy these contents to our other machines that we want to have the same secret key.<\/span><\/p>\n\n\n\n$ cat ~\/.google_authenticator\nHZGVGLVG2ES4N5DW\n” TOTP_AUTH\n45850250\n14934076\n63800816\n93689045\n82870703<\/pre>\n\n\n\nInstalling Google Authenticator On Additional Machines<\/h4>\n\n\n\n For all other machines I’m going to install Google Authenticator as normal, but I’m going to use the secret key from the first machine. This will let me log into each of them using that same secret key that I stored from the first machine.<\/span><\/p>\n\n\n\n1 – Install Google Authenticator. Again, other places describe this in detail. We’re going to install the program but not do the creation of any secret keys<\/span><\/p>\n\n\n\n$ sudo apt-get install libpam-google-authenticator \n\u2026<\/pre>\n\n\n\n2 – Create the configuration file and add the content that we got from the other machine:<\/p>\n\n\n\n
$ cat ->> ~\/.google_authenticator\nHZGVGLVG2ES4N5DW\n” TOTP_AUTH\n45850250\n14934076\n63800816\n93689045\n82870703\n<ctrl-D><\/pre>\n\n\n\n3 – Set permissions for the configuration file.<\/p>\n\n\n\n
$ chmod 400 ~\/.google_authenticator<\/pre>\n\n\n\n4 – Restart the ssh service.<\/p>\n\n\n\n
$ service ssh restart<\/pre>\n\n\n\n5 – Test the login<\/p>\n\n\n\n
$ ssh topher@192.168.56.101\nPassword:\nVerification code:\nWelcome to Ubuntu 12.04.3 LTS (GNU\/Linux 3.8.0-29-generic i686)<\/pre>\n\n\n\nVoila! A shared Google Authenticator secret key across my servers! Happy day.<\/p>\n","protected":false},"excerpt":{"rendered":"
https:\/\/live-jc-marketing-site.pantheonsite.io\/wp\/wp-admin\/post.php?post=1012&action=edit<\/p>\n","protected":false},"author":9,"featured_media":1239,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_oasis_is_in_workflow":0,"_oasis_original":0,"_oasis_task_priority":"","inline_featured_image":false,"footnotes":""},"categories":[23],"tags":[],"collection":[],"platform":[],"funnel_stage":[3016],"coauthors":[2511],"acf":[],"yoast_head":"\n
Sharing Google Authenticator Secret Keys Across Servers - JumpCloud<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n