I am using Windows 11 Pro Version: 21H2 (Build: 22000.978)
So I have OpenSSH on my device which is also added to system path variable as shown below in the command prompt snippet.
C:\Windows\System32>set path
Path=C:\oraclexe\app\oracle\product\11.
\VMware Workstation\bin\;C:\WINDOWS\sys
1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Pr
\ProgramData\nvm;C:\Program Files\nodej
m Files\dotnet\;C:\Android\android-sdk\
in;C:\Program Files\Git\cmd;C:\Program
I'm inside System32 folder in my command prompt (normal window | non-admin) and I opened the Explorer in the current directory by entering:
explorer .
I do see OpenSSH folder, but when I try to go inside (change directory) to OpenSSH, the command prompt throws an error denoting that the path does not exist. But it does exist on the drive!
C:\Windows\System32>cd OpenSSH
The system cannot find the path specified.
And obviously I cannot access ssh.exe
which is located inside OpenSSH directory.
But interestingly, when I elevate the shell (open CMD as administrator) and try to access the OpenSSH directory or even the file ssh.exe
, it worked! When I use the where
command for ssh
, it points to that right directory as shown below:
Command prompt as standard user:
C:\Windows\System32>ssh
'ssh' is not recognized as an internal or external command,
operable program or batch file.
Command prompt as administrator:
C:\Users\Admin>where ssh
C:\Windows\System32\OpenSSH\ssh.exe
It just does not work for cmd in normal window but works when cmd is opened as administrator.