You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
subsystem executable paths with "spaces" do not workΒ #784
What is failing
Execution of powershell as subsystem.
Actual output
I configured the sshd_config file as follows: Subsystem powershell C:\Program Files\PowerShell\6.0.0.17\powershell.exe -sshs -NoLogo -NoProfile
The sshd log file states following message regarding to the execution of the subsystem: 2956 11:50:35:760 debug1: Executing command: C:\\Program Files\\OpenSSH\\C:\\Program Files\\PowerShell\\6.0.0.17\\powershell.exe -sshs -NoLogo -NoProfile
This fails and the connection crushes. So I set the path in the sshd_config relatively to the OpenSSH folder: Subsystem powershell ..\PowerShell\6.0.0.17\powershell.exe -sshs -NoLogo -NoProfile
which fixed the issue.
Is it only me experiencing this or had any of you the same issue?
changed the title [-]sshd_config subsystem path relatively to OpenSSH folder[/-][+]sshd_config subsystem path being relatively to OpenSSH folder[/+]on Jun 23, 2017
What does this command do ?
C:\Program Files\PowerShell\6.0.0.17\powershell.exe -sshs -NoLogo -NoProfile
Here is the analysis,
My sshdconfig -
Subsystem powershell C:\Program Files\PowerShell\6.0.0.14\powershell.exe -sshs -NoLogo -NoProfile
When I tried to do ssh using "./ssh.exe localadmin@127.0.0.1 -s powershell".. my sshd.log shows that it executed the correct path but failed with different error message.
Logic - When you specify a relative path, we add the sshd.exe path. This is the reason it works fine.
sshd.log-
42292 17:54:16:346 debug1: subsystem: exec() C:\Program Files\PowerShell\6.0.0.14\powershell.exe -sshs -NoLogo -NoProfile
42292 17:54:16:346 Starting session: subsystem 'powershell' for localadmin from 127.0.0.1 port 34233 id 0
42292 17:54:16:346 debug3: pipe - r-h:412,io:00000280A9F525E0,fd:7 w-h:288,io:00000280A9F526D0,fd:8
42292 17:54:16:346 debug3: pipe - r-h:420,io:00000280A9F9BEE0,fd:9 w-h:416,io:00000280A9F9BFD0,fd:10
42292 17:54:16:346 debug3: pipe - r-h:428,io:00000280A9F9C0C0,fd:11 w-h:424,io:00000280A9F9C1B0,fd:12
42292 17:54:16:347 debug2: fd 7 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 8 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 9 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 10 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 11 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 12 setting O_NONBLOCK
42292 17:54:16:347 debug1: Executing command: C:\Program Files\PowerShell\6.0.0.14\powershell.exe -sshs -NoLogo -NoProfile
42292 17:54:16:348 debug3: Register child 00000000000001B4 pid 42444, 0 zombies of 0
42292 17:54:16:348 debug2: fd 3 setting TCP_NODELAY
42292 17:54:16:349 debug3: close - io:00000280A9F525E0, type:2, fd:7, table_index:7
42292 17:54:16:349 debug3: close - io:00000280A9F9BFD0, type:2, fd:10, table_index:10
42292 17:54:16:349 debug3: close - io:00000280A9F9C1B0, type:2, fd:12, table_index:12
42292 17:54:16:349 debug3: fd 9 is O_NONBLOCK
42292 17:54:16:349 debug3: fd 8 is O_NONBLOCK
42292 17:54:16:349 debug3: fd 11 is O_NONBLOCK
42292 17:54:16:349 debug3: send packet: type 99
42292 17:54:23:530 debug2: channel 0: read 103 from efd 11
42292 17:54:23:531 debug3: channel 0: discard efd
42292 17:54:23:542 debug2: channel 0: read<=0 rfd 9 len 0
42292 17:54:23:542 debug2: channel 0: read failed
42292 17:54:23:542 debug2: channel 0: close_read
42292 17:54:23:542 debug3: close - io:00000280A9F9BEE0, type:2, fd:9, table_index:9
42292 17:54:23:542 debug2: channel 0: input open -> drain
42292 17:54:23:542 debug2: channel 0: read 0 from efd 11
42292 17:54:23:542 debug2: channel 0: closing read-efd 11
42292 17:54:23:542 debug3: close - io:00000280A9F9C0C0, type:2, fd:11, table_index:11
42292 17:54:23:542 debug2: channel 0: ibuf empty
42292 17:54:23:542 debug2: channel 0: send eof
42292 17:54:23:542 debug3: send packet: type 96
42292 17:54:23:542 debug2: channel 0: input drain -> closed
42292 17:54:23:547 debug3: zombie'ing child at index 0, 0 zombies of 1
42292 17:54:23:547 debug1: Received SIGCHLD.
42292 17:54:23:547 debug3: Unregister child at index 0, 1 zombies of 1
42292 17:54:23:547 debug1: session_by_pid: pid 42444
42292 17:54:23:548 debug1: session_exit_message: session 0 channel 0 pid 42444
42292 17:54:23:548 debug2: channel 0: request exit-status confirm 0
42292 17:54:23:548 debug3: send packet: type 98
42292 17:54:23:548 debug1: session_exit_message: release channel 0
42292 17:54:23:548 debug2: channel 0: write failed
42292 17:54:23:548 debug2: channel 0: close_write
42292 17:54:23:548 debug3: close - io:00000280A9F526D0, type:2, fd:8, table_index:8
42292 17:54:23:548 debug2: channel 0: send eow
42292 17:54:23:548 debug3: send packet: type 98
42292 17:54:23:548 debug2: channel 0: output open -> closed
42292 17:54:23:548 debug2: channel 0: send close
42292 17:54:23:548 debug3: send packet: type 97
42292 17:54:23:548 debug3: channel 0: will not send data after close
42292 17:54:23:548 debug2: notify_done: reading
42292 17:54:23:548 debug3: channel 0: will not send data after close
42292 17:54:23:548 debug3: receive packet: type 97
42292 17:54:23:548 debug2: channel 0: rcvd close
42292 17:54:23:548 debug3: channel 0: will not send data after close
42292 17:54:23:548 debug2: channel 0: is dead
42292 17:54:23:548 debug2: channel 0: gc: notify user
42292 17:54:23:548 debug1: session_by_channel: session 0 channel 0
42292 17:54:23:548 debug1: session_close_by_channel: channel 0 child 0
42292 17:54:23:548 Close session: user localadmin from 127.0.0.1 port 34233 id 0
42292 17:54:23:548 debug3: session_unused: session id 0 unused
42292 17:54:23:548 debug2: channel 0: gc: user detached
42292 17:54:23:548 debug2: channel 0: is dead
42292 17:54:23:548 debug2: channel 0: garbage collecting
42292 17:54:23:548 debug1: channel 0: free: server-session, nchannels 1
42292 17:54:23:548 debug3: channel 0: status: The following connections are open:\r\n #0 server-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n
42292 17:54:23:548 debug3: WSARecv - WSARecv() ERROR: io:00000280A9F52290 10054
42292 17:54:23:548 debug3: recv - from CB ERROR:108, io:00000280A9F52290
42292 17:54:23:549 Read error from remote host 127.0.0.1 port 34233: Unknown error
42292 17:54:23:549 debug1: do_cleanup
Using a direct ssh session from Ubuntu to Windows with the "-s powershell" argument isn't working with this workaround. But somehow the "Enter-PSSession"-command in PowerShell 6 is only running with the relative path...
The issue is with space " " in the subsystem executable path (ProgramFiles). I checked the code and the current implementation does not support it.
As a work around, you could create a symlink (with no spaces in its path) the following way and specify the link in the subsystem path
mklink /H c:\pslink.exe "C:\Program Files\PowerShell\6.0.0.17\powershell.exe"
Add this in sshd_config
Subsystem powershell C:\pslink.exe -sshs -NoLogo -NoProfile
changed the title [-]sshd_config subsystem path being relatively to OpenSSH folder[/-][+]subsystem executable paths with "spaces" do not work[/+]on Jun 28, 2017
tested on the unix environment. Unix has a way to escape the spaces in the path..
ex - /home/Ubuntu/test\ directory/ -> Here we escape the space in "test directory" using .
I hit the same issue on Server 2016 but found that neither mklink nor New-Item would create a usable symlink (The application to execute does not exist: 'C:\users\Public\pwsh.dll')
I ended up creating a directory link c:\powershell to resolve it.
Actually, there is absolutely no need for any script nor any hardlink, just basic knowledge of Windows PowerShell....
Just use the 8.3 notation of the path (with / instead of \) to pwsh.exe in sshd_config:
Actually, there is absolutely no need for any script nor any hardlink, just basic knowledge of Windows PowerShell....
Just use the 8.3 notation of the path (with / instead of \) to pwsh.exe in sshd_config:
Justin Grote (@JustinGrote)
Thank you, but can you pinpoint it to me, because searching here I can't find it.
(Especially since there is no source code here.)
I want to confirm that neither of the methods used by Fakhrulhilal M (@fakhrulhilal) works.
I also tried creating both SymbolicLink and HardLink to pwsh.exe and even via Registry edit, but all to no avail. For some reason the OpenSSH sshd_config, never respects the -NoLogo -NoProfile.
eabase - If the issued is not resolved then please open a new issue as your problem seems to be with the arguments.
Please note any changes to sshd_config requires a restart of sshd process (net stop sshd; net start sshd).
Attach client side logs (ssh -vvv user@ip) and sshd server side logs with DEBUG3 enabled.
Why has this bug not been fixed?
After all, it's been a good 3+ years since first reported...
It looks like it is an open source project; contributions are welcome.
But you don't expect people who're not familiar with the technology stack used in this repo to fix the code, right? Not all of them familiar with C/C++. Contribution doesn't have to be fixing code. Reporting the issue (with clear explanation) is a contribution as well.
Reporting the issue (with clear explanation) is a contribution as well.
Apparently not so much here. It seem that we're the 3Ο fringe users and that the only ones actually using the native Windows OpenSSH, are a handful of paid MS developers already on the latest OS, tools and internal knowledge. Personally I thought it would be more maintainable and neat to use a native client, but I see now, it's still a dead old fish to revive, which is why I've been using Cygwin's SSH for ~25 years. Not even WSL is making this UX better. Windows could never catch up and always messed up settings and expected functionalities and compatibility etc. (Can't even get the default sshd_config file correct.) So for anything remote, apart running 1 or 2 commands, it's TeamViewer or Cygwins' SSH/SCP. Then there's the integration issues with PSReadLine: 42 years of VT100 ANSI and MS still can't get it right! π
ok found it here, but IMHO I wouldn't call that "documented"...
eabase, the (current) documentation does have this here. It's a shortened version of -SSHServerMode. I know it'd been a few years since this was noted, but thought I'd close the loop with the current documentation.
Unless I missed it, nobody mentions that escaping spaces with a \ in Windows does work unless it's new behaviour in Server 2025 which is what I am remoting to
To show the 8.3 paths, use dir /x in cmd.exe, noting that the short names are creation order dependent - "program files" is usually progra~1 because it is created before "program files (x86)" during Windows installation
I found that in sshd_config, not only does the short name Progra~1 work but also quotes with absolute addresses as Subsystem powershell "C:/Program Files/PowerShell/7/pwsh.exe" -sshs.
Activity
[-]sshd_config subsystem path relatively to OpenSSH folder[/-][+]sshd_config subsystem path being relatively to OpenSSH folder[/+]bagajjal commentedon Jun 24, 2017
Phil Pound (@philSixZero) - I tried this and got a different error.
What does this command do ?
C:\Program Files\PowerShell\6.0.0.17\powershell.exe -sshs -NoLogo -NoProfile
Here is the analysis,
My sshdconfig -
Subsystem powershell C:\Program Files\PowerShell\6.0.0.14\powershell.exe -sshs -NoLogo -NoProfile
When I tried to do ssh using "./ssh.exe localadmin@127.0.0.1 -s powershell".. my sshd.log shows that it executed the correct path but failed with different error message.
Logic - When you specify a relative path, we add the sshd.exe path. This is the reason it works fine.
sshd.log-
42292 17:54:16:346 debug1: subsystem: exec() C:\Program Files\PowerShell\6.0.0.14\powershell.exe -sshs -NoLogo -NoProfile
42292 17:54:16:346 Starting session: subsystem 'powershell' for localadmin from 127.0.0.1 port 34233 id 0
42292 17:54:16:346 debug3: pipe - r-h:412,io:00000280A9F525E0,fd:7 w-h:288,io:00000280A9F526D0,fd:8
42292 17:54:16:346 debug3: pipe - r-h:420,io:00000280A9F9BEE0,fd:9 w-h:416,io:00000280A9F9BFD0,fd:10
42292 17:54:16:346 debug3: pipe - r-h:428,io:00000280A9F9C0C0,fd:11 w-h:424,io:00000280A9F9C1B0,fd:12
42292 17:54:16:347 debug2: fd 7 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 8 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 9 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 10 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 11 setting O_NONBLOCK
42292 17:54:16:347 debug2: fd 12 setting O_NONBLOCK
42292 17:54:16:347 debug1: Executing command: C:\Program Files\PowerShell\6.0.0.14\powershell.exe -sshs -NoLogo -NoProfile
42292 17:54:16:348 debug3: Register child 00000000000001B4 pid 42444, 0 zombies of 0
42292 17:54:16:348 debug2: fd 3 setting TCP_NODELAY
42292 17:54:16:349 debug3: close - io:00000280A9F525E0, type:2, fd:7, table_index:7
42292 17:54:16:349 debug3: close - io:00000280A9F9BFD0, type:2, fd:10, table_index:10
42292 17:54:16:349 debug3: close - io:00000280A9F9C1B0, type:2, fd:12, table_index:12
42292 17:54:16:349 debug3: fd 9 is O_NONBLOCK
42292 17:54:16:349 debug3: fd 8 is O_NONBLOCK
42292 17:54:16:349 debug3: fd 11 is O_NONBLOCK
42292 17:54:16:349 debug3: send packet: type 99
42292 17:54:23:530 debug2: channel 0: read 103 from efd 11
42292 17:54:23:531 debug3: channel 0: discard efd
42292 17:54:23:542 debug2: channel 0: read<=0 rfd 9 len 0
42292 17:54:23:542 debug2: channel 0: read failed
42292 17:54:23:542 debug2: channel 0: close_read
42292 17:54:23:542 debug3: close - io:00000280A9F9BEE0, type:2, fd:9, table_index:9
42292 17:54:23:542 debug2: channel 0: input open -> drain
42292 17:54:23:542 debug2: channel 0: read 0 from efd 11
42292 17:54:23:542 debug2: channel 0: closing read-efd 11
42292 17:54:23:542 debug3: close - io:00000280A9F9C0C0, type:2, fd:11, table_index:11
42292 17:54:23:542 debug2: channel 0: ibuf empty
42292 17:54:23:542 debug2: channel 0: send eof
42292 17:54:23:542 debug3: send packet: type 96
42292 17:54:23:542 debug2: channel 0: input drain -> closed
42292 17:54:23:547 debug3: zombie'ing child at index 0, 0 zombies of 1
42292 17:54:23:547 debug1: Received SIGCHLD.
42292 17:54:23:547 debug3: Unregister child at index 0, 1 zombies of 1
42292 17:54:23:547 debug1: session_by_pid: pid 42444
42292 17:54:23:548 debug1: session_exit_message: session 0 channel 0 pid 42444
42292 17:54:23:548 debug2: channel 0: request exit-status confirm 0
42292 17:54:23:548 debug3: send packet: type 98
42292 17:54:23:548 debug1: session_exit_message: release channel 0
42292 17:54:23:548 debug2: channel 0: write failed
42292 17:54:23:548 debug2: channel 0: close_write
42292 17:54:23:548 debug3: close - io:00000280A9F526D0, type:2, fd:8, table_index:8
42292 17:54:23:548 debug2: channel 0: send eow
42292 17:54:23:548 debug3: send packet: type 98
42292 17:54:23:548 debug2: channel 0: output open -> closed
42292 17:54:23:548 debug2: channel 0: send close
42292 17:54:23:548 debug3: send packet: type 97
42292 17:54:23:548 debug3: channel 0: will not send data after close
42292 17:54:23:548 debug2: notify_done: reading
42292 17:54:23:548 debug3: channel 0: will not send data after close
42292 17:54:23:548 debug3: receive packet: type 97
42292 17:54:23:548 debug2: channel 0: rcvd close
42292 17:54:23:548 debug3: channel 0: will not send data after close
42292 17:54:23:548 debug2: channel 0: is dead
42292 17:54:23:548 debug2: channel 0: gc: notify user
42292 17:54:23:548 debug1: session_by_channel: session 0 channel 0
42292 17:54:23:548 debug1: session_close_by_channel: channel 0 child 0
42292 17:54:23:548 Close session: user localadmin from 127.0.0.1 port 34233 id 0
42292 17:54:23:548 debug3: session_unused: session id 0 unused
42292 17:54:23:548 debug2: channel 0: gc: user detached
42292 17:54:23:548 debug2: channel 0: is dead
42292 17:54:23:548 debug2: channel 0: garbage collecting
42292 17:54:23:548 debug1: channel 0: free: server-session, nchannels 1
42292 17:54:23:548 debug3: channel 0: status: The following connections are open:\r\n #0 server-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n
42292 17:54:23:548 debug3: WSARecv - WSARecv() ERROR: io:00000280A9F52290 10054
42292 17:54:23:548 debug3: recv - from CB ERROR:108, io:00000280A9F52290
42292 17:54:23:549 Read error from remote host 127.0.0.1 port 34233: Unknown error
42292 17:54:23:549 debug1: do_cleanup
bagajjal commentedon Jun 24, 2017
SSHD receive SIGCHLD from the ssh client so it closed the connection.
42292 17:54:23:530 debug2: channel 0: read 103 from efd 11
42292 17:54:23:531 debug3: channel 0: discard efd
42292 17:54:23:542 debug2: channel 0: read<=0 rfd 9 len 0
42292 17:54:23:542 debug2: channel 0: read failed
42292 17:54:23:542 debug2: channel 0: close_read
42292 17:54:23:542 debug3: close - io:00000280A9F9BEE0, type:2, fd:9, table_index:9
42292 17:54:23:542 debug2: channel 0: input open -> drain
42292 17:54:23:542 debug2: channel 0: read 0 from efd 11
42292 17:54:23:542 debug2: channel 0: closing read-efd 11
42292 17:54:23:542 debug3: close - io:00000280A9F9C0C0, type:2, fd:11, table_index:11
42292 17:54:23:542 debug2: channel 0: ibuf empty
42292 17:54:23:542 debug2: channel 0: send eof
42292 17:54:23:542 debug3: send packet: type 96
42292 17:54:23:542 debug2: channel 0: input drain -> closed
42292 17:54:23:547 debug3: zombie'ing child at index 0, 0 zombies of 1
42292 17:54:23:547 debug1: Received SIGCHLD.
bagajjal commentedon Jun 24, 2017
The same thing works if you specify cmd.exe in sshd_config
Subsystem mycmd C:\Windows\System32\cmd.exe
use
ssh user@ip -s mycmd
philSixZero commentedon Jun 27, 2017
Using a direct ssh session from Ubuntu to Windows with the "-s powershell" argument isn't working with this workaround. But somehow the "Enter-PSSession"-command in PowerShell 6 is only running with the relative path...
manojampalam commentedon Jun 28, 2017
The issue is with space " " in the subsystem executable path (ProgramFiles). I checked the code and the current implementation does not support it.
As a work around, you could create a symlink (with no spaces in its path) the following way and specify the link in the subsystem path
mklink /H c:\pslink.exe "C:\Program Files\PowerShell\6.0.0.17\powershell.exe"
Add this in sshd_config
Subsystem powershell C:\pslink.exe -sshs -NoLogo -NoProfile
[-]sshd_config subsystem path being relatively to OpenSSH folder[/-][+]subsystem executable paths with "spaces" do not work[/+]bagajjal commentedon Jun 29, 2017
tested on the unix environment. Unix has a way to escape the spaces in the path..
ex - /home/Ubuntu/test\ directory/ -> Here we escape the space in "test directory" using .
We need to find a way that suits windows.
dantraMSFT commentedon Aug 31, 2018
I hit the same issue on Server 2016 but found that neither mklink nor New-Item would create a usable symlink (The application to execute does not exist: 'C:\users\Public\pwsh.dll')
I ended up creating a directory link c:\powershell to resolve it.
JustinGrote commentedon Dec 28, 2018
For those who came here from the MSFT documentation like I did, here's a script to automate the process on Windows.
https://gist.github.com/JustinGrote/72d7baaa6cc99691b7c4cb3caad54891
Zerowalker commentedon Aug 3, 2019
How's this coming along?
gildas commentedon Oct 9, 2019
Actually, there is absolutely no need for any script nor any hardlink, just basic knowledge of Windows PowerShell....
Just use the 8.3 notation of the path (with
/instead of\) to pwsh.exe in sshd_config:IMO, there is no bug in the code as spaces are simply not allowed. Just use whatever the current OS uses to escape said spaces...
As a side note, for whatever reason restarting the sshd service was not enough for me, I had to restart the server.
he852100 commentedon Oct 31, 2019
In fact,
progra-1works.\No problem.7 remaining items
eabase commentedon Oct 4, 2020
Justin Grote (@JustinGrote)
Thank you, but can you pinpoint it to me, because searching here I can't find it.
(Especially since there is no source code here.)
JustinGrote commentedon Oct 4, 2020
It was a joke but it's in the github.com/powershell/powershell repository.
eabase commentedon Oct 4, 2020
Any idea why it's not documented as a normal command argument??
pwsh /hcertinly doesn't say anything.eabase commentedon Oct 4, 2020
ok found it here, but IMHO I wouldn't call that "documented"...
eabase commentedon Oct 5, 2020
I want to confirm that neither of the methods used by Fakhrulhilal M (@fakhrulhilal) works.
I also tried creating both SymbolicLink and HardLink to
pwsh.exeand even via Registry edit, but all to no avail. For some reason the OpenSSH sshd_config, never respects the-NoLogo -NoProfile.bagajjal commentedon Oct 6, 2020
eabase - If the issued is not resolved then please open a new issue as your problem seems to be with the arguments.
Please note any changes to sshd_config requires a restart of sshd process (net stop sshd; net start sshd).
Attach client side logs (ssh -vvv user@ip) and sshd server side logs with DEBUG3 enabled.
eabase commentedon Oct 14, 2020
Why has this bug not been fixed?
After all, it's been a good 3+ years since first reported...
mwtrigg commentedon Oct 14, 2020
It looks like it is an open source project; contributions are welcome.
fakhrulhilal commentedon Oct 29, 2020
But you don't expect people who're not familiar with the technology stack used in this repo to fix the code, right? Not all of them familiar with C/C++. Contribution doesn't have to be fixing code. Reporting the issue (with clear explanation) is a contribution as well.
eabase commentedon Oct 31, 2020
Fakhrulhilal M (@fakhrulhilal)
Apparently not so much here. It seem that we're the 3Ο fringe users and that the only ones actually using the native Windows OpenSSH, are a handful of paid MS developers already on the latest OS, tools and internal knowledge. Personally I thought it would be more maintainable and neat to use a native client, but I see now, it's still a dead old fish to revive, which is why I've been using Cygwin's SSH for ~25 years. Not even WSL is making this UX better. Windows could never catch up and always messed up settings and expected functionalities and compatibility etc. (Can't even get the default sshd_config file correct.) So for anything remote, apart running 1 or 2 commands, it's TeamViewer or Cygwins' SSH/SCP. Then there's the integration issues with PSReadLine: 42 years of VT100 ANSI and MS still can't get it right! π
vGruntus commentedon Jun 28, 2023
eabase, the (current) documentation does have this here. It's a shortened version of
-SSHServerMode. I know it'd been a few years since this was noted, but thought I'd close the loop with the current documentation.guyrleech commentedon Jul 8, 2024
Unless I missed it, nobody mentions that escaping spaces with a \ in Windows does work unless it's new behaviour in Server 2025 which is what I am remoting to
To show the 8.3 paths, use dir /x in cmd.exe, noting that the short names are creation order dependent - "program files" is usually progra~1 because it is created before "program files (x86)" during Windows installation
Zhaopudark commentedon Dec 31, 2024
Following the doc
Install the SSH service on a Windows computer, and Example 6: Start an interactive session using SSH, I use
Enter-PSSession -HostName '<username>@<windows_server_ip>'to connect a remote Windows Server over SHH.I found that in
sshd_config, not only does the short nameProgra~1work but also quotes with absolute addresses asSubsystem powershell "C:/Program Files/PowerShell/7/pwsh.exe" -sshs.My environments are:
So, I'm not sure if this problem still exists.
pa-jberanek commentedon Apr 9, 2025
Similar to Guy Leech (@guyrleech) 's suggestion, putting double-quotes around the path also works, so:
Apologies, also a duplicate of Pu Zhao (@Zhaopudark) 's comment above, mea culpa.