3

When I am trying to use ssh using powershell 7 it throws and error:

ssh: The term 'ssh' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Error in powershell

But it is working fine for cmd and windows powershell Working on CMD Working on Windows Powershell

I have also noticed that I cannot change directory to OpenSSH (C:\Windows\System32\OpenSSH) Cannot cd to OpenSSH

I tried adding Openssh to the system Path, installing openssh client and server but did not work.

How can I fix it?

  • when you are logged in as `adnan` what does `where ssh.exe` say the executable resides? – Nathan McCoy Aug 07 '23 at 10:15
  • In powershell 7, it doesn't say anything but in other terminals (cmd) it outputs: C:\Windows\System32\OpenSSH\ssh.exe – Adnan Bin Zahir Aug 07 '23 at 11:57
  • Have you checked for existing alias or batch-file with same name: `Get-Alias -Name ssh` ? Probably there are different paths: if 32-bit application includes the "\System32" folder name in a folder path, the system automatically makes a redirection to the SysWOW64 folder – Daemon-5 Aug 08 '23 at 02:39
  • @Daemon-5, No there is no existing alias. `Get-Alias -Name ssh` outputs: `Get-Alias: This command cannot find a matching alias because an alias with the name 'ssh' does not exist.` – Adnan Bin Zahir Aug 09 '23 at 08:19

0 Answers0