@@ -43,15 +43,15 @@ In addition you will need to enable password authentication and optionally key b
43
43
1. Install the latest [Win32 Open SSH] build from GitHub using the [installation] instructions
44
44
1. Edit the sshd_config file at the location where you installed Win32 Open SSH
45
45
- Make sure password authentication is enabled
46
- ```bash
46
+ ```none
47
47
PasswordAuthentication yes
48
48
```
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
52
52
```
53
53
- Optionally enable key authentication
54
- ```bash
54
+ ```none
55
55
PubkeyAuthentication yes
56
56
```
57
57
1. Restart the sshd service
@@ -65,23 +65,59 @@ In addition you will need to enable password authentication and optionally key b
65
65
## Setup on Linux (Ubuntu 14.04) Machine
66
66
67
67
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
- ```
73
68
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
+ ```
76
73
1. Edit the sshd_config file at location /etc/ssh
77
74
- Make sure password authentication is enabled
78
- + PasswordAuthentication yes
75
+ ```none
76
+ PasswordAuthentication yes
77
+ ```
79
78
- Add a PowerShell subsystem entry
80
- + Subsystem powershell powershell -sshs -NoLogo -NoProfile
79
+ ```none
80
+ Subsystem powershell /usr/bin/powershell -sshs -NoLogo -NoProfile
81
+ ```
81
82
- Optionally enable key authentication
82
- + PubkeyAuthentication yes
83
+ ```none
84
+ PubkeyAuthentication yes
85
+ ```
83
86
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
+ ```
85
121
86
122
## PowerShell Remoting Example
87
123
@@ -182,3 +218,4 @@ GitCommitId v6.0.0-alpha.17
182
218
[ installation ] : https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
183
219
[ PowerShell for Linux ] : https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#ubuntu-1404
184
220
[ 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