OpenSSH is the premier connectivity tool for remote login with the SSH protocol. It encrypts all traffic to eliminate eavesdropping, connection hijacking, and other attacks. In addition, OpenSSH provides a large suite of secure tunneling capabilities, several authentication methods,. Introduction to OpenSSH The OpenSSH package contains ssh clients and the sshd daemon. This is useful for encrypting authentication and subsequent traffic over a network. The ssh and scp commands are secure implementions of telnet and rcp respectively. This package is known to build and work properly using an LFS-7.10 platform.
Use SSH on Windows, how running/launching graphical programs on remote computer in the same user session logon on Windows OS.
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.
Openssh 7.6p1
Connect to the remote machine with ssh and run notepad.exe on the remote computer in the same user sessions opened.