ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Installing OpenSSH on Windows via Chocolatey

    IT Discussion
    ssh openssh windows 10 windows microsoft open source security chocolatey sam windows administration system administration
    3
    6
    11.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Microsoft has been working on porting the OpenSSH SSH client and server packages to Windows and has made the package available via Chocolatey! The package is known as win32-openssh. This is super, duper exciting - both that they have gotten these packages available and that they are working with Chocolatey packaging to make this as easy as possible for users.

      This OpenSSH port is open source and includes both client and server components. That means that you can install the client tools and use these on Windows instead of using a third party tool, such as PuTTY. You can use native ssh commands directly from inside of a Windows shell session. Having an SSH server means that we can remote into a Windows machine directly from every other OS (they all have native SSH these days except for Windows) and execute PowerShell the same way that we use Bash on Linux, for example. Unified management, so handy.

      Installing the client components is incredibly easy. Assuming that Chocolatey is already installed, from our PS prompt we just run:

      choco install win32-openssh
      

      That's it. Reload your shell environment and you can ssh directly into any available server just as if you were on Mac OSX, Linux, BSD or whatever.

      Now to install the SSH Server (or SSHD in UNIX terminology, the "d" standing for daemon) on Windows instead we would use the following commands:

      choco install win32-openssh -params '"/SSHServerFeature /KeyBasedAuthenticationFeature"'
      Restart-Computer
      

      The reboot is necessary, but it we look at a screenshot of the installation process, we can see that the Chocolatey installer is not just installing our OpenSSH server package, but that it is also setting the service to start automatically and modifying the Windows firewall to open port 22 (the SSH port) so that we are able to use the service right away. We need to reboot for this to take effect, however.

      0_1469295645388_Screenshot from 2016-07-23 13:31:43.png

      JaredBuschJ 1 Reply Last reply Reply Quote 2
      • scottalanmillerS
        scottalanmiller
        last edited by

        top running on an SSH session from PowerShell to a remote Linux Mint host.

        0_1469298240071_Screenshot from 2016-07-23 13:28:22.png

        alex.olynykA 1 Reply Last reply Reply Quote 1
        • alex.olynykA
          alex.olynyk @scottalanmiller
          last edited by

          @scottalanmiller Thanks. I installed this via chocolately. How do I discover the OpenSSH commands so i can use them?

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch @scottalanmiller
            last edited by

            @scottalanmiller said in Installing OpenSSH on Windows via Chocolatey:

            Installing the client components is incredibly easy. Assuming that Chocolatey is already installed, from our PS prompt we just run:

            Chocolatey is designed to run from an elevated command prompt, not PowerShell. Obviously you can still execute basic shell commands from PowerShell also, but it is in no way required.

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @alex.olynyk
              last edited by

              @alex.olynyk said in Installing OpenSSH on Windows via Chocolatey:

              @scottalanmiller Thanks. I installed this via chocolately. How do I discover the OpenSSH commands so i can use them?

              I only know of ssh and sftp being ported.

              alex.olynykA 1 Reply Last reply Reply Quote 0
              • alex.olynykA
                alex.olynyk @scottalanmiller
                last edited by

                @scottalanmiller Thanks. I got it. I overthink everything. 🙂

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post