ssh into the fas cluster without having to enter your password or 2fa code for Linux or Mac.
The way this program works is by using a tool called expect and oathtool. expect
allows you to put your password and 2FA code into this script once so you don't have enter them each time. The 2FA code is generated by oathtool
and a 2FA seed. You can find your harvard 2FA seed here at the section "ADDITIONAL INFORMATION AND HINTS".
-
Install oathtool. Mac oathtool can be installed from here and linux from here.
expect
should already be installed by default. -
In the
cluster
script, replace<CLUSTER_USERNAME>
with your cluster username,<PASSWORD>
with your actual password, and<2FA>
with the code from here -
Move this script to somewhere in your PATH.
-
Profit! You can now ssh into the cluster easily with the command
cluster
.