Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, March 31, 2020 12:41 PM
sshd doesn't start on Windows 10? 64bit 1909(I installed built-in openssh). Powershell output:
PS C:\Windows\system32> Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Name : OpenSSH.Client~~~~0.0.1.0
State : Installed
Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresent
PS C:\Windows\system32> Start-Service sshd
PS C:\Windows\system32> sshd
sshd : Имя "sshd" не распознано как имя командлета, функции, файла сценария или выполняемой
программы. Проверьте правильность написания имени, а также наличие и правильность пути, посл
е чего повторите попытку.
строка:1 знак:1
- sshd
-
+ CategoryInfo : ObjectNotFound: (sshd:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Windows\system32> ssh
ssh : Имя "ssh" не распознано как имя командлета, функции, файла сценария или выполняемой пр
ограммы. Проверьте правильность написания имени, а также наличие и правильность пути, после
чего повторите попытку.
строка:1 знак:1
- ssh
-
+ CategoryInfo : ObjectNotFound: (ssh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Windows\system32>
All replies (13)
Tuesday, March 31, 2020 1:07 PM
Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresentPS C:\Windows\system32> Start-Service sshd
PS C:\Windows\system32> sshd
sshd : Имя "sshd" не распознано как имя командлета, функции, файла сценария или выполняемойn
You didn't install the server component so yes, there is no sshd service or program.
You did install the client, but that install adds the directory C:\WINDOWS\System32\OpenSSH\ to the system path. You need to close that Powershell window and open up a new one to pick up the change.
Wednesday, April 1, 2020 9:47 AM
I don't need a server. I closed and opened Powershell many times(as admin user also) and rebooted the system too. So, seems like ssh client doesn't start.
Wednesday, April 1, 2020 10:42 AM
I don't need openssh server, I need only client. But I tried one of options which you suggested:
PS C:\Windows\system32> Install-Module -Force OpenSSHUtils
Для продолжения требуется поставщик NuGet
Для взаимодействия с репозиториями на основе NuGet модулю PowerShellGet требуется версия
поставщика NuGet "2.8.5.201" или более новая. Поставщик NuGet должен быть доступен в
"C:\Program Files\PackageManagement\ProviderAssemblies" или
"C:\Users\rulet\AppData\Local\PackageManagement\ProviderAssemblies". Поставщик NuGet можно
также установить, выполнив команду "Install-PackageProvider -Name NuGet -MinimumVersion
2.8.5.201 -Force". Вы хотите, чтобы модуль PowerShellGet установил и импортировал поставщик
NuGet прямо сейчас?
[Y] Да - Y [N] Нет - N [S] Приостановить - S [?] Справка
(значением по умолчанию является "Y"):
PackageManagement\Install-Package : Модуль "OpenSSHUtils" не может быть установлен или обнов
лен, так как подпись Authenticode файла "OpenSSHUtils.psd1" недопустима.
C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 знак:21
- ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power....InstallPackage:InstallP
ackage) [Install-Package], Exception
+ FullyQualifiedErrorId : InvalidAuthenticodeSignature,ValidateAndGet-AuthenticodeSigna
ture,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
PS C:\Windows\system32>
But when I run ssh client from a folder where it is, it runs:
PS C:\Windows\System32\OpenSSH> .\ssh.exe
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]
PS C:\Windows\System32\OpenSSH
So, seems like I only need to add to system path folder which contains ssh.exe. How to do that correctly?
... Ok, for now I added to PATH using system tools
https://drive.google.com/open?id=1s5fEM8sxshTZu7BSO3lsoak1G1OFD0QR
Wednesday, April 1, 2020 1:04 PM
... Ok, for now I added to PATH using system tools
https://drive.google.com/open?id=1s5fEM8sxshTZu7BSO3lsoak1G1OFD0QR
Do you have the path embedded in the path? That's redundant and might slow your system down.
This Powershell command will expand the environment variable directories.
(get-childitem env:\path).value.split(";")
Wednesday, April 1, 2020 8:05 PM
Do you have the path embedded in the path? That's redundant and might slow your system down.
I don't remember, seems like it was from the beginning of a system installation. I just added some folders. How can it slow the system? I don't see any slow downs. How it should be right way?
PS C:\Users\rulet> (get-childitem env:\path).value.split(";")
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
%PATH%
C:\mpv-x86_64-20191229-git-49cbc50
C:\Windows\System32\OpenSSH
C:\Users\rulet\AppData\Local\Microsoft\WindowsApps
PS C:\Users\rulet>
Wednesday, April 1, 2020 9:00 PM
When something goes to load a program or DLL, the OS will first look in the current directory for the process. If it doesn't find it, it then searches all of the directories in the PATH. If your "PATH" had been duplicated in the "PATH" (which is what it looked like to me) then you have double entries which would be searched whenever a program or DLL was loaded.
When I run that Powershell command, I see the Windows and application directories as I would expect.
When I check the environment variables. I see the system path...
And a user path whose directories are appended to the system path.
Having %PATH% in the PATH doesn't look right. And if you are having problems running programs it could be because you are missing the Windows folders.
It looks like some application install tried to add its directory to the path by appending the folder and was expecting %PATH% to be expanded with all of the current path's folder names, but instead just got the character string "%PATH%".
Wednesday, April 1, 2020 9:04 PM
So, do I have to delete that %PATH% in a Path?
Wednesday, April 1, 2020 9:20 PM
I would. And you also need to need to add in Windows entries.
%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
Do you have access to another machine where you could compare the entries?
You may also be missing some entries for other applications that were installed on your machine.
Wednesday, April 1, 2020 9:56 PM
Ok, thanks for answer. I don't have access to another machine(maybe will try in a virtual machine). For now I just deleted %PATH% in a system Path and rebooted. I'll see how it works and then I will add that entries to system "Path" which you suggested. Probably ssh didn't started because %SystemRoot%\system32 wasn't in a system "Path". I don't understand how it happend.
For now it is:
PS C:\Windows\system32> (get-childitem env:\path).value.split(";")
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
C:\mpv-x86_64-20191229-git-49cbc50
C:\Windows\System32\OpenSSH
C:\Users\rulet\AppData\Local\Microsoft\WindowsApps
PS C:\Windows\system32>
Wednesday, April 1, 2020 10:04 PM
I don't understand how it happend.
If I were to guess...… it would be the install for C:\mpv-x86_64-20191229-git-49cbc50 whatever that is...
Wednesday, April 1, 2020 10:10 PM
I added C:\mpv-x86_64-20191229-git-49cbc50 manually, that just video, audio player(very powerfull). Sometimes I run that player in command line.
Thursday, April 2, 2020 9:14 AM
What is %SystemRoot%\System32\Wbem, and why not to add just %SystemRoot%\system32 and %SystemRoot% ? If I understad right %SystemRoot%\System32\Wbem and %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ is inside %SystemRoot%\system32 folder?
Thursday, April 2, 2020 12:49 PM
What is %SystemRoot%\System32\Wbem,
That is WMI.
why not to add just %SystemRoot%\system32 and %SystemRoot% ?
That would be better than what you have, but the Windows OS developers must have a reason for needing the WBEM folder in the path.
If I understad right %SystemRoot%\System32\Wbem and %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ is inside %SystemRoot%\system32 folder?
A PATH search does not include subfolders.