Skip to content

Commit 646b6a6

Browse files
SteveL-MSFTdaxian-dbw
authored andcommitted
Add setup steps for MacOS to use PSRP over SSH (PowerShell#4872)
1 parent 4c29f57 commit 646b6a6

File tree

2 files changed

+56
-16
lines changed

2 files changed

+56
-16
lines changed

.spelling

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ sshs
240240
TestUser
241241
UbuntuVM1
242242
UbuntuVM1s
243+
usr
244+
launchctl
245+
com.openssh.sshd
243246
- demos/SystemD/readme.md
244247
Get-SystemDJournal
245248
journalctl

demos/SSHRemoting/README.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ In addition you will need to enable password authentication and optionally key b
4343
1. Install the latest [Win32 Open SSH] build from GitHub using the [installation] instructions
4444
1. Edit the sshd_config file at the location where you installed Win32 Open SSH
4545
- Make sure password authentication is enabled
46-
```bash
46+
```none
4747
PasswordAuthentication yes
4848
```
49-
- Add a PowerShell subsystem entry, replace `c:/program files/powershell/6.0.0.17/powershell.exe` with the correct path to the version you want to use
50-
```bash
51-
Subsystem powershell c:/program files/powershell/6.0.0.17/powershell.exe -sshs -NoLogo -NoProfile
49+
- Add a PowerShell subsystem entry, replace `c:/program files/powershell/6.0.0/powershell.exe` with the correct path to the version you want to use
50+
```none
51+
Subsystem powershell c:/program files/powershell/6.0.0/powershell.exe -sshs -NoLogo -NoProfile
5252
```
5353
- Optionally enable key authentication
54-
```bash
54+
```none
5555
PubkeyAuthentication yes
5656
```
5757
1. Restart the sshd service
@@ -65,23 +65,59 @@ In addition you will need to enable password authentication and optionally key b
6565
## Setup on Linux (Ubuntu 14.04) Machine
6666
6767
1. Install the latest [PowerShell for Linux] build from GitHub
68-
- You can tell if it has the SSH remoting support by looking at the parameter sets for New-PSSession
69-
```powershell
70-
Get-Command New-PSSession -syntax
71-
New-PSSession [-HostName] <string[]> [-Name <string[]>] [-UserName <string>] [-KeyFilePath <string>] [-SSHTransport] [<CommonParameters>]
72-
```
7368
1. Install [Ubuntu SSH] as needed
74-
- sudo apt install openssh-client
75-
- sudo apt install openssh-server
69+
```bash
70+
sudo apt install openssh-client
71+
sudo apt install openssh-server
72+
```
7673
1. Edit the sshd_config file at location /etc/ssh
7774
- Make sure password authentication is enabled
78-
+ PasswordAuthentication yes
75+
```none
76+
PasswordAuthentication yes
77+
```
7978
- Add a PowerShell subsystem entry
80-
+ Subsystem powershell powershell -sshs -NoLogo -NoProfile
79+
```none
80+
Subsystem powershell /usr/bin/powershell -sshs -NoLogo -NoProfile
81+
```
8182
- Optionally enable key authentication
82-
+ PubkeyAuthentication yes
83+
```none
84+
PubkeyAuthentication yes
85+
```
8386
1. Restart the sshd service
84-
- sudo service sshd restart
87+
```bash
88+
sudo service sshd restart
89+
```
90+
91+
## Setup on MacOS Machine
92+
93+
1. Install the latest [PowerShell for MacOS] build
94+
- Make sure SSH Remoting is enabled by following these steps:
95+
+ Open `System Preferences`
96+
+ Click on `Sharing`
97+
+ Check `Remote Login` - Should say `Remote Login: On`
98+
+ Allow access to appropriate users
99+
1. Edit the `sshd_config` file at location `/private/etc/ssh/sshd_config`
100+
- Use your favorite editor or
101+
```bash
102+
sudo nano /private/etc/ssh/sshd_config
103+
```
104+
- Make sure password authentication is enabled
105+
```none
106+
PasswordAuthentication yes
107+
```
108+
- Add a PowerShell subsystem entry
109+
```none
110+
Subsystem powershell /usr/local/bin/powershell -sshs -NoLogo -NoProfile
111+
```
112+
- Optionally enable key authentication
113+
```none
114+
PubkeyAuthentication yes
115+
```
116+
1. Restart the sshd service
117+
```bash
118+
sudo launchctl stop com.openssh.sshd
119+
sudo launchctl start com.openssh.sshd
120+
```
85121
86122
## PowerShell Remoting Example
87123
@@ -182,3 +218,4 @@ GitCommitId v6.0.0-alpha.17
182218
[installation]: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
183219
[PowerShell for Linux]: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#ubuntu-1404
184220
[Ubuntu SSH]: https://help.ubuntu.com/lts/serverguide/openssh-server.html
221+
[PowerShell for MacOS]: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#macos-1012

0 commit comments

Comments
 (0)