How do I connect to SSH using 2FA?

Austin Beresford
Published: 16 July 2019
Share:

It's only recommend that you connect to your package via SSH if you're familiar with the command line interface. Here is how to connect using two-factor authentication (2FA).

Setting up your authenticator:

You will want to first download the Google Authenticator app which is available for both iOS and Android devices.

⦁    Log in to My20i, head to Manage Hosting and select the package that you require SSH access for. Then select SSH Access under the Security section.
⦁    Under Set SSH password, set the password and make note of this for later. Then select Set up Authenticator and proceed to scan the QR code on your iOS or Android device.

Connect SSH via 2FA: Windows

If you're using Windows you will want to download an SSH client to to access SSH. 
You can download PuTTy from the following page: https://www.putty.org/

⦁    Open PuTTY and enter the SSH hostname here. The hostname you wish to use depends on what data centre you’re using. For the UK, use ‘ssh.gb.stackcp.com’, and for the US use ‘ssh.us.stackcp.com’. Then, select Open.  
⦁    The command line interface will request you for a login. Log in with your domain (e.g. example.co.uk) 
⦁    You will then be prompted for a verification code. Open Google Authenticator and enter your code.
⦁    Enter the SSH password which was set up earlier.  
⦁    You'll now have access to SSH through 2FA.

Connect SSH via 2FA: Apple Mac

For Mac, you can make use of the Terminal utility, which should be available as standard.

  • Open Terminal and enter the SSH hostname and username found at the top of the SSH Access section. This will follow the format of domain.com@ssh.gb.stackcp.com for packages in the UK, and domain.com@ssh.gb.stackcp.com for packages in the US. You’ll need to prefix it with the ssh command as follows:       

UK:  ssh domain.com@ssh.gb.stackcp.com

US:  ssh domain.com@ssh.us.stackcp.com

  • You’ll be prompted for a password – this will be the password you set during the creation of the 2FA setup. Enter this, and then your Google Authenticator code when prompted.
  • You’ll now have SSH access