How do I establish an SSH connection with a private/public key pair?

How do I establish an SSH connection with a private/public key pair?


PhotoSync allows you to transfer your photos/videos securely via SSH. If you don't want to enter your password directly or you don't want to enter a password at all you can secure your SSH server with a private/public key authentication.

First, create a private/public key pair to secure your server. On the command line enter ssh-keygen and run through the creation process. Starting with OpenSSH 7.8 for RSA keys there will be a different signature in the key file and PhotoSync will not be able to detect these keys, so it is recommended to use the -m PEM parameter when you create your key pair, so e.g. ssh-keygen -m PEM -t rsa -b 4096 for a 4096 bit RSA key.

Figure 1. Create a private/public key pair
Create a private/public key pair

 

Next, secure your SSH server and add you public key (in this example id_rsa.pub) to the ~/.ssh/authorized_keys file on your server.

Now connect your iOS device with iTunes, in iTunes click the icon for your device, then click on File Sharing in the sidebar, select PhotoSync in the Apps list and click Add to add your private key file to PhotoSync. Change to the folder where you created your private/public key pair and select the private key file. Once it is added to the "PhotoSync Documents" it is available in the SSH configuration of the PhotoSync app.

 

Figure 2. Select PhotoSync in the Apps list
Select PhotoSync in the Apps list

 

 

Figure 3. Select private key file
Select private key file

 

 

Figure 4. Private key file copied into PhotoSync
Private key file copied into PhotoSync

 

In PhotoSync now enter the Settings, choose Configure > FTP/SFTP and create your SSH connection. Switch SFTP/SSH on, enter your server address and you login and tap on the key to select your private key file. PhotoSync now offers you the file that you added via iTunes. Select it and you're able to connect to your SSH server without entering and storing a password.

 

Figure 5. Open PhotoSync settings
Open PhotoSync settings

 

 

Figure 6. Configure FTP/SSH connection
Configure FTP/SSH connection

 

 

Figure 7. Select SFTP/SSH and enter server and username
Select SFTP/SSH and enter server and username

 

 

Figure 8. Select private key file
Select private key file

 

 

Figure 9. Private key file selected
Private key file selected

 

 

Figure 10. Connection established
Connection established

 

699 out of 1240 found this article helpful
Was this article helpful? Yes | No

Go back

Need more support?