SSH - Specific Clients - OpenSSH Windows
- Last Updated: April 6, 2022
- 3 minute read
- MOVEit Transfer
- Version 2024.1
- Version 2024
- Documentation
Preparation
This guide assumes you have already installed a copy of OpenSSH for Windows.
If you have not already installed OpenSSH for Windows, be sure to UNCHECK the Server box on the Choose Components section during the installation of this client.
Instructions
- Select or CREATE a directory where the OpenSSH known_hosts and key files will be located (\Program Files\OpenSSH\bin\ssh is a good choice). We will refer to this directory as SSHDIR throughout this guide. When referenced in a command, be sure to substitute in your value.
- Open a command-prompt, navigate to the \Program Files\OpenSSH\bin directory, and
execute the following command:
sftp -oUserKnownHostsFile=SSHDIR\known_hosts user@hostThis will come back with a warning that the host is not known. Enter yes to the question. This will add the host's key to the known_hosts file. Then, simply press CONTROL+C to leave the application. Example:
C:\Program Files\OpenSSH\bin>sftp -oUserKnownHostsFile=C:\Progra~1\OpenSSH\bin\ssh\known_hostssshkeyboy@dotnet.corp.stdnet.comConnecting to dotnet.corp.stdnet.com...The authenticity of host 'dotnet.corp.stdnet.com (192.168.3.15)' can't be established.RSA key fingerprint is ce:08:6f:28:87:b6:50:f4:84:e5:37:c2:68:89:33:2a.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'dotnet.corp.stdnet.com,192.168.3.15' (DSA)to the list of known hosts.sshkeyboy@dotnet.corp.stdnet.com's password:(CONTROL+C)C:\Program Files\OpenSSH\bin> - Execute the following command:
ssh-keygen -t rsaWhen asked to enter a file to save the key in, use this value:
SSHDIR\id_rsaWhen asked for a password, simply hit enter (and again when asked to confirm). This will create an RSA key which will be used to authenticate to the server. The ssh-keygen program should give the key files their correct permissions automatically. Example:
C:\Program Files\OpenSSH\bin>ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (P7 quot;/.ssh/id_rsa): c:\progra~1\OpenSSH\bin\ssh\id_rsaEnter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in c:\progra~1\OpenSSH\bin\ssh\id_rsa.Your public key has been saved in c:\progra~1\OpenSSH\bin\ssh\id_rsa.pub.The key fingerprint is:44:a8:8c:88:3f:3f:91:8a:16:07:e4:c6:4a:6e:b8:df xxxx@jglshuttleC:\Program Files\OpenSSH\bin> - Execute the following command:
sftp -oUserKnownHostsFile=SSHDIR\known_hosts -oIdentityFile=SSHDIR\id_rsa user@hostThis will come back asking for the user's password. Simply Control-C out of the program at this point. Example:
C:\Program Files\OpenSSH\bin>sftp -oUserKnownHostsFile=c:\progra~1\OpenSSH\bin\ssh\known_hosts -oIdentityFile=c:\progra~1\OpenSSH\bin\ssh\id_rsa sshkeyboy@dotnet.corp.stdnet.comConnecting to dotnet.corp.stdnet.com...sshkeyboy@dotnet.corp.stdnet.com's password:(CONTROL+C)C:\Program Files\OpenSSH\bin> - The new key's fingerprint should now be logged on the MOVEit Transfer
host. Log on through the web interface as an administrator, click up the user's
profile, go into the user's SSH policy, and ACCEPT the SSH key from the client
key holding tank. (The key fingerprint is circled in RED in the image below.)

Open the user's profile and under User Authentication > SSH Policy > Current SSH Keys, add this fingerprint. A properly configured user will have a profile similar to the following:


- You should now be able to automatically connect to the MOVEit Transfer
host via SFTP using the following command:
sftp -oUserKnownHostsFile=SSHDIR\known_hosts -oIdentityFile=SSHDIR\id_rsa user@hostExample:
C:\Program Files\OpenSSH\bin>sftp -oUserKnownHostsFile=c:\progra~1\OpenSSH\bin\ssh\known_hosts -oIdentityFile=c:\progra~1\OpenSSH\bin\ssh\id_rsa sshkeyboy@dotnet.corp.stdnet.comConnecting to dotnet.corp.stdnet.com...sftp> pwdRemote working directory: /Home/SSH Key Boysftp> cd ..sftp> cd ..sftp> dirDistributionHomeWebPostsftp> - To use SFTP in an automated setting, use the -b command-line option to supply
SFTP with a list of commands to be issued. Example:
C:\>type sftp_commands.txtcd /Home/Steveput certreq.txtdirquitC:\>c:\progra~1\openssh\bin\sftp-oUserKnownHostsFile=c:\progra~1\openssh\bin\ssh\known_hosts -oIdentityFile=c:\progra~1\openssh\bin\ssh\id_rsa -b sftp_commands.txt steve@dotnet.corp.stdnet.comConnecting to dotnet.corp.stdnet.com...sftp> cd /Home/Stevesftp> put certreq.txtUploading certreq.txt to /Home/Steve/certreq.txtsftp> dirDecSet_6858908.exeMIFreelyInst_9971297.exebrain_1731860.wavcertreq_1140952.txtdecryptedFile_5848271.datdmz_backups_2157003.htmlwebpost_bundle_4594384.xmlsftp> quit