Using HiPerGator without Dual Factor Authentication every time

2 minute read

Published:

Hipergator recently updated to a dual factor authentication for logging in, which means for people who use it daily and and need to login multiple sessions, it can get annoying pretty fast. The workaround is to use ssh multiplexing which can allow you to use an existing TCP connection for multiple sessions. More on multiplexing here. In other words, given that you log in and authenticate once, and as long as the initial terminal remains open, you can log into multiple sessions without authentication. Although I would advise against it, but you can increase the time from 8hrs.

Generating SSH Keys for passwordless login

Open Terminal. Generate SSH key for login into hipergator without password. You can specify the names here if you already have rsa key pair.

ssh-keygen

It will ask for passphrase, just press enter if you don’t want any passphrase. A randomart will be generated for the key fingerprint. You will then have to copy your id using ssh copy as follows:

ssh-copy-id USERNAME@hpg.rc.ufl.edu

It will ask for password for your gatorlink. After you have entered the password, your ssh keys are set up in ~/.ssh folder. You can cd into the path to check if the public and private key pair exists. Now you can login without needing to enter password using:

ssh USERNAME@hpg.rc.ufl.edu

This is great but you will still need to autheticate using dual factor authentication.

Adding Multiplexing to ssh config file

Now you can create a config file in the ~/.ssh folder. To do so, either use vim or nano or an editor of your choosing to create a file ~/.ssh/config

Now add the following information into this config file.

Host hpg
    User USERNAME
    HostName hpg.rc.ufl.edu
    Port 2222
    IdentityFile ~/.ssh/id_rsa
    ControlPath ~/.ssh/cm-%r@%l-%h:%p
    ControlMaster auto
    ControlPersist 8h

You will need to change the USERNAME to your gatorlink, and the name of identity file ( if different name was chosen for generating ssh keys) You can also change the number of hours in ControlPersist if you want to keep it longer, although i wouldn’t recommend it. Save and close the file. Now you can login using:

ssh hpg

At this point if you woul like, you can create an alias for it. See my blog post here

For transfering files using scp

From Computer to hipergator

scp FileONcomputerToTransfer hpg:/path/on/cluster

From Hipergator to computer

scp hpg:/path/on/cluster path/on/computer

Leave a Comment