GithubHelp home page GithubHelp logo

stevel-msft / enablesshremoting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulhigin/enablesshremoting

2.0 2.0 0.0 16 KB

Module for cmdlets that enable and test PowerShell 6.0+ SSH based remoting

License: MIT License

PowerShell 100.00%

enablesshremoting's Introduction

EnableSSHRemoting

PowerShell SSH remoting was implemented in PowerShell 6.0 but requries SSH (client) and SSHD (service) components to be installed. In addition the sshd_config configuration file must be updated to define a PowerShell endpoint as a subsystem. Once this is done PowerShell remoting cmdlets can be used to establish a PowerShell remoting session over SSH that works across platforms.

$session = New-PSSession -HostName LinuxComputer1 -UserName UserA -SSHTransport

There are a number of requirements that must be satisfied for PowerShell SSH based remoting:

  • PowerShell 6.0 or greater must be installed on the system. Since multiple PowerShell installations can appear on a single system, a specific installation can be selected.
  • SSH client must be installed on the system as PowerShell uses it for outgoing connections.
  • SSHD (ssh daemon) must be installed on the system for PowerShell to receive SSH connections.
  • SSHD must be configured with a Subsystem that serves as the PowerShell remoting endpoint.

This module exports a single cmdlet: Enable-SSHRemoting

The Enable-SSHRemoting cmdlet will do the following:

  • Detect the underlying platform (Windows, Linux, macOS).
  • Detect an installed SSH client, and emit a warning if not found.
  • Detect an installed SSHD daemon, and emit a warning if not found.
  • Accept a PowerShell (pwsh) path to be run as a remoting PowerShell session endpoint, or try to use the currently running PowerShell.
  • Update the SSHD configuration file to add a PowerShell subsystem endpoint entry.

If all of the conditions are satisfied then PowerShell SSH remoting will work to and from the local system.

enablesshremoting's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.