SFTP Setup for Linux

Before you begin

Please be sure that you have added the IP address of the imports.gradesfirst.com server (184.73.226.62) to your firewall whitelist.

For this IP, you will want to open ports 22 and 1025 through 65535. Port 22 is the control port for SFTP. Any port in the range of 1025 through 65535 can be used for data transfer.

Generating your SSH Key

GitHub provides a wonderful guide on this here. For convenience, here is an abbreviated version:

1. Change directories to the current user's .ssh directory cd ~/.ssh

2. Use ssh-keygen to generate a new ssh key. When asked to enter a file, enter "test_sftp".

ssh-keygen -t rsa -C "your_email@example.com"

3. When prompted, enter a passphrase and then enter the passphrase again.

Connecting to imports.gradesfirst.com via SFTP

1. Your public key will need to be in OpenSSH format.

Example:

ssh-rsa AAAAB3NzaC1yc2EAAasdfdsarewthri/Fx+YPpbHOIcSEQAsGSr4wKLrXegWDPubHK4xf0lNLIvoHnF3N+ wleFGOpUYkQeasHUJpc5jebCclCpjk+dw1fuVZdijsOvKrSm5PPXmYsPVKIBp1p1vzqaRNc69NXmpqO1 AL9czJ6T27yY9FK/gzDN1LRxq8V/5He9Q== rsa-key-20121001

2. Copy the contents of your newly created public key (test_sftp.pub) into the "SSH Public Key" field on the SFTP configuration admin screen in the GradesFirst application.

3. Now, use the command below to connect to the GradesFirst import server via SFTP. When prompted for a password, enter the passphrase. Once you've entered your passphrase, you shouldn't have to enter it again for subsequent sftp connections.

sftp -i test_sftp your-subdomain@imports.gradesfirst.com

4. You should now see a "sftp >" prompt indicating that you are connected to the server. Type "exit" to close the connection.

Transferring files to imports.gradesfirst.com

1. On your local server, create a test file called test_file.csv with a single line as its contents: GradesFirst Import Version=4

2. Connect to imports.gradesfirst.com

sftp -i test_sftp your-subdomain@imports.gradesfirst.com

3. From the "sftp >" connection prompt, use the command below to transfer a file to the imports.gradesfirst.com server. put test_file.csv

4. Type "exit" to close the connection.

Troubleshooting on Linux

1. Verify that you have entered the correct public key into the SFTP configuration screen in GradesFirst. Be sure to double check that this public key is the key which corresponds to the private key you are using to connect. Please also check that the key is in OpenSSH format.

Example:

ssh-rsa AAAAB3NzaC1yc2EAAasdfdsarewthri/Fx+YPpbHOIcSEQAsGSr4wKLrXegWDPubHK4xf0lNLIvoHnF3N+ wleFGOpUYkQeasHUJpc5jebCclCpjk+dw1fuVZdijsOvKrSm5PPXmYsPVKIBp1p1vzqaRNc69NXmpqO1 AL9czJ6T27yY9FK/gzDN1LRxq8V/5He9Q== rsa-key-20121001

2. Verify that the IP address of the imports.gradesfirst.com server (184.73.226.62) has been added to the firewall whitelist for the machine and network area from which you are trying to connect. Also verify that ports 22 and 1025 through 65535 are open for this IP.

3. Try generating a new key pair, entering the new public key in GradesFirst, and connecting using the new key pair.