Fixing Duo Issues with SSH and sFTP
Two-factor authentication is becoming more and more of standard operating procedure for large organizations. Oregon State University is no different. Many of you are accustomed to using Duo to authenticate when logging into your email or Canvas.
What some of you may not have realized is that two-factor authentication is now required for logging into Flip. This can cause problems with people who are not using a terminal to access the school servers as there is an additional prompt that requires a response. This is of particular inconvenience to those using FTP programs.
Below are guides to help streamline logging onto Flip without the need of involving Duo.
Windows Guide
For this you will need:
- PuTTY Key Generator - a program to generate ssh private and public keys
- PuTTY - a terminal emulator
- FileZilla - an sFTP client
Steps
- Open up PuTTY Key Generator, click “Generate,” and follow the on-screen instructions
-
Once the key is generated, you will need to save the public key
Save it to a location you will be able to easily find it and name it
id_rsa.pub
-
Now you need to save the private key
Ignore the warning about the passcode. Save it to the same location as before and name it
id_rsa.ppk
- Using PuTTY, log onto Flip and enter your password when prompted
-
You will be presented with a Duo two-factor prompt. Enter
1
and press enter. This will send a request to your Duo Mobile app which you will need to accept - You are now logged onto Flip
- Use your favorite command text editor (mine is emacs) to open up
~/.ssh/authorized_keys
which should be an empty file. If it does not exist, create it -
Now, locate the public key file you saved and open it with notepad and copy the key as shown in the image below
-
Back in the editor on Flip, type
ssh-rsa
followed by a space and the paste the copied public key and save the changes -
Back in PuTTY, you want to create a Saved Session you have not done so already
-
In Host Name enter
your_username@access.engr.oregonstate.edu
-
Below in the Saved Sessions field enter
flip
and click Save -
Click Connect->SSH->Auth on the sidebar
-
On this screen, Browse to the location of your private key file: id_rsa.ppk. Now click the Open Button at the bottom
-
You should not be logged onto Flip without needing to provide a password OR two-factor authorization
-
-
Now we need to set up FileZilla
-
Open FileZilla and go to File->Site Manager
-
Create a New Site and name it
flip
-
To the right in the General Tab, Select
SFTP
for the Protocol and enter the Host asaccess.engr.oregonstate.edu
-
For Logon Type select
Key file
, enter your username for User, and then browse to the location of your `id_rsa.ppk’ file. -
Click Connect at the bottom and you should now be connected to Flip without the need of two-factor authentication!
-
macOS Guide
For this you will need:
- Access to a terminal
- Cyberduck
Steps
-
Open up your terminal application and type
ssh-keygen -t rsa
-
You will then be asked to choose a save location for the keys. You can choose the default by pressing
enter
. Then hitenter
two more times to skip creating a passcode -
Once the key is generated you should see something similar to the image below. Please ensure you remember where your
id_rsa
file is saved -
Still in the terminal, type
ssh-copy-id your_username@access.engr.oregonstate.edu
. This will publish your public key to Flip -
When prompted enter your password
-
You should now see the two-factor Duo authentication. Enter
1
to send a push to your Mobile Duo app -
Now you need to create a config file in the directory where you have your saved keys. If you used the default save location you can do this by entering
touch ~/.ssh/config
-
Once created, you can use your favorite text edit (mine is emacs) to open the file
-
To this file you need to add three lines
Host flip
- whereflip
is the name of the shortcut you want to createHostName access.engr.oregonstate.edu
-
User your_username
-
To log into Flip using the key simply type
ssh flip
and you will connect without having to enter a password or do two-factor authentication -
Now it is time to configure Cyberduck for FTP
-
Open up Cyberduck and click the Open Connection button
-
You need to select the connection type and change it to
SFTP
-
Now you must enter your username
-
Do not enter a password and change SSH Private Key from
none
to the location of yourid_rsa
file. If you followed the default settings it should already be listed without needing to browse -
Finally click the Connect button and you will be logged into Flip without the need for a password or 2-factor authentication
-
Linux Guide
Given the large amounts of different Linux distributions there is no one guide that will work for all. You can use Steps 1-10 of the macOS Guide to generate your keys and publish them to Flip. From that point on you will need to use your FTP client of your choice.
Acknowledgements
Eric Ianni authored this document. Additionally he wanted to make sure he acknowledged the very talented and motivated members of OSU’s unofficial Slack group (osu-cs.slack.com/). They were the motivation to create these guides and much of the content was covered users’ discussions, but it is his hope this will provide a more permanent source of information.