
Use SSH on Windows, how running/launching graphical programs on remote computer in the same user session logon on Windows OS.
Server - to install the ssh server command line application (if you want to provide an ssh server for others to connect to) Start Menu Shortcuts - a few start menu shortcuts The next screen that requires some explanation is the 'Choose account under which to execute SSHD'. The SSH Daemon (SSHD) can run as either LocalSystem or SSHDServer. This tutorial is for Windows 7 but contains mostly screenshots from the English version of Windows Vista. Separate instructions for other versions of Windows are also available: Windows Vista. The instructions for Windows 2000/XP are also still available. To be able to mount a Windows share over SSH we will need.
Requirements:
– OpenSSH (you can download the binaries from the official repository on github https://github.com/PowerShell/Win32-OpenSSH/releases)
– PsTools (official useful tools from Microsoft https://docs.microsoft.com/en-us/sysinternals/downloads/pstools)
– PowerShell

- Download the tools
- Copy the content of the folder PSTools under “C:WindowsSystem32”.
- Open the cmd as administrator and run C:WindowsSystem32psexec.exe, accept the eula license.
- Download the latest OpenSSH for Windows binaries (package OpenSSH-Win64.zip or OpenSSH-Win32.zip)
- As the Administrator, extract the package to %PROGRAMFILES%OpenSSH
note: the folder must be named “OpenSSH” - Open PowerShell as the Administrator (right click on PowerShell icon, “run as administrator”), change directory to “C:Program FilesOpenSSH” install sshd and ssh-agent services with the command
- Allow incoming connections to SSH server in Windows Firewall:
– Either run the following PowerShell command (Windows 8 and 2012 or newer only), as the Administrator:– or go to Control Panel > System and Security > Windows Firewall> Advanced Settings > Inbound Rules and add a new rule for port 22.
- Start the service and/or configure automatic start:
◦ Go to Control Panel > System and Security > Administrative Tools and open Services. Locate sshd service.
◦ If you want the server to start automatically when your machine is started: Go to Action > Properties. In the Properties dialog, change Startup type to Automatic and confirm.
◦ Start the sshd service by clicking the Start the service. - Create the ~./.ssh folder under C:Users<user>.ssh
- Create the file “authorized_keys” under ~./.ssh
- Run the scrips to fix/check correct permission a PowerShell with administrator privilege.
- Personalize your SSH server settings editing the configuration file %PROGRAMDATA%sshsshd_config.
- Do the step from 1 to 2 from the above paragraph “Install SSH Server on Windows 7 / 10”
- Open cmd.exe as Administrator and run ssh-keygen.exe and press enter to all message for default configuration
- Copy the private and public key on the ~.ssh folder of the user that you want use on the server.Run ssh-add.exe to add you private and public key to the ssh-agent.
Note: ensure that ssh-agent is running.
Connect to the remote machine with ssh and run notepad.exe on the remote computer in the same user sessions opened.
Recently, Microsoft has released a port of OpenSSH for Windows. You can use the package to set up an SFTP/SSH server on Windows.
- Installing SFTP/SSH Server
- Connecting to the server
Advertisement
- In Settings app, go to Apps > Apps & features > Manage optional features.
- Locate “OpenSSH server” feature, expand it, and select Install.
Binaries are installed to %WINDIR%System32OpenSSH. Configuration file (sshd_config) and host keys are installed to %ProgramData%ssh (only after the server is started for the first time).
You may still want to use the following manual installation if you want to install a newer version of OpenSSH than the one built into Windows 10.
- Download the latest OpenSSH for Windows binaries (package
OpenSSH-Win64.ziporOpenSSH-Win32.zip) - As the Administrator, extract the package to
C:Program FilesOpenSSH - As the Administrator, install sshd and ssh-agent services:
- Allow incoming connections to SSH server in Windows Firewall:
- When installed as an optional feature, the firewall rule “OpenSSH SSH Server (sshd)” should have been created automatically. If not, proceed to create and enable the rule as follows.
- Either run the following PowerShell command as the Administrator:
ReplaceC:System32OpenSSHsshd.exewith the actual path to thesshd.exe(C:Program FilesOpenSSHssh.exe, had you followed the manual installation instructions above). - or go to Control Panel > System and Security > Windows Defender Firewall1 > Advanced Settings > Inbound Rules and add a new rule for port 22.
- Start the service and/or configure automatic start:
- Go to Control Panel > System and Security > Administrative Tools and open Services. Locate OpenSSH SSH Server service.
- If you want the server to start automatically when your machine is started: Go to Action > Properties. In the Properties dialog, change Startup type to Automatic and confirm.
- Start the OpenSSH SSH Server service by clicking the Start the service.

These instructions are partially based on the official deployment instructions.
Follow a generic guide for Setting up SSH public key authentication in *nix OpenSSH server, with the following difference:
Win7 Ssh Server
- Create the
.sshfolder (for theauthorized_keysfile) in your Windows account profile folder (typically inC:Usersusername.ssh).2 - For permissions to the
.sshfolder and theauthorized_keysfile, what matters are Windows ACL permissions, not simple *nix permissions. Set the ACL so that the respective Windows account is the owner of the folder and the file and is the only account that has a write access to them. The account that runs OpenSSH SSH Server service (typicallySYSTEMorsshd) needs to have read access to the file. - Though, with the default Win32-OpenSSH configuration there is an exception set in
sshd_configfor accounts inAdministratorsgroup. For these, the server uses a different location for the authorized keys file:%ALLUSERSPROFILE%sshadministrators_authorized_keys(i.e. typicallyC:ProgramDatasshadministrators_authorized_keys).
Before the first connection, find out the fingerprint of the server’s host key by using ssh-keygen.exe for each file.
In Windows command-prompt, use:
Best for business mac or pc. Replace %WINDIR%System32 with %ProgramFiles%, if appropriate.
In PowerShell, use:
Replace $env:WINDIRSystem32 with $env:ProgramFiles, if appropriate.
You will get an output like this:
Start WinSCP. Login dialog will appear. On the dialog:
Windows 7 Ssh Key
- Make sure New site node is selected.
- On New site node, make sure the SFTP protocol is selected.
- Enter your machine/server IP address (or a hostname) into the Host name box.
- Enter your Windows account name to the User name box. It might have to be entered in the format
user@domainif running on a domain. - For a public key authentication:
- Press the Advanced button to open Advanced site settings dialog and go to SSH > Authentication page.
- In Private key file box select your private key file.
- Submit Advanced site settings dialog with the OK button.
- For a password authentication:
- Enter your Windows account password to the Password box.
- If your Windows account does not have a password, you cannot authenticate with the password authentication (i.e. with an empty password), you need to use the public key authentication.
- Save your site settings using the Save button.
- Login using Login button.
- Verify the host key by comparing fingerprints with those collected before (see above).
Advertisement
If you cannot authenticate to the server and use Windows 10 Developer mode, make sure that your OpenSSH server does not conflict with an internal SSH server used by the Developer mode. You may need to turn off the SSH Server Broker and SSH Server Proxy Windows services. Or run your OpenSSH server on a different port than 22.
- Guide to Installing Secure FTP Server on Windows using IIS;
- Guide to uploading files to SFTP server;
- Guide to automating operations (including upload).
Ssh Windows 7
- Windows Firewall on older versions of Windows.Back
- Windows File Explorer does not allow you to create a folder starting with a dot directly. As a workaround, use
.ssh., the trailing dot will allow you to bypass the restriction, but will not be included in the name.Back
