Ssh no such file or directory windows

Почему не могу подключиться по ssh, и как это исправить?

На сервере стоит httpd, который выдает 403 ошибку:

Forbidden
You don’t have permission to access / on this server

  • Вопрос задан более трёх лет назад
  • 4689 просмотров

Adamos: «У вас же есть текст ошибки: «key_load_public: No such file or directory». «

Это НЕ текст ошибки. Это просто текст попыток подставить дефолтные публичные ключи. Которыми не пользовались.

Текст ошибки это «ssh_exchange_identification: read: Connection reset by peer» без внятного пояснения причины, и это может быть 100500 причин.

Эти проваленные попытки могут быть, например, свидетельством того, что ключи есть, но на файлы стоит слишком широкий доступ (не 700)

Adamos: «Эпроваленные попытки могут быть, например, свидетельством того, что ключи есть, но на файлы стоит слишком широкий доступ (не 700), и SSH не желает их принимать всерьез.»

Не могут.
1) При некорректных правах выдается не «No such file or directory», а «bad permissions: ignore key: /home/name/.ssh/id_rsa».
Причем дополнительная ошибка выведется даже без -vvv в консоль.

2) Кроме того, поскольку самих файлов нет, то попытки обращения на удаленный сервер НЕ происходит — каждая эта строчка это не провальная попытка авторизации, а попытка чтения локальным ssh настроек, после чего он должен просто сообщить удаленному серверу что «я хочу зайти по паролю», но тот сразу отвергает это.

3) Кроме того, топикстартер явно сообщил, что он НЕ пользовался ключами, а всегда вводил пароль.

windows 10 ssh proxycommand: “posix_spawn: No such file or directory”

I use Windows10 and I need to use a jumphost to get to my Linux servers. Thus I have configured my .ssh\config like so:

But when I run ssh server01.server.local -v (dash-v for verbose) I get the following error:

5 Answers 5

As per this bug, the fix is to use a full path. So this is the correct line in the .ssh/config :

The ProxyCommand should invoke ssh with .exe extension, for example:

The long(?) story

Running ssh -vvv XXX shows:

According to CreateProcess document on MSDN, I guess posix_spawn is calling CreateProcess in a way that lpApplicationName argument must be exact and absolute path. After specifying the .exe suffix, it seems to be fixed.

Читайте также:  Ventafax для windows 10

I got same error but it was because of DISPLAY environment variable set to some value. Once you unset that environment variable, the error went away.

This issue has to do with a bug in the OpenSSH Windows implementaiton. This bug is fixed with release 8.1.0.0. Detailed instructions on how to patch the version can be found here

Since netcat is not available on a default system, the following two entries in the .ssh/config will do the trick (assuming that the local username and the remote username are distinct).

login.bar : system to login
jump.bar : jumphost
: remote user name on login.bar and jump.bar (if they are distinct @jump.bar is needed). If you omit @ in front of jump.bar the local username is taken.

In both cases login to login.bar with: ssh foo

Not the answer you’re looking for? Browse other questions tagged ssh proxy windows-10 or ask your own question.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

error: cannot run ssh: No such file or directory when trying to clone on windows

I am trying to clone on windows a remote repository, so when i did this:

I got this error:

Am i missing something ? Thanx in advance.

5 Answers 5

You don’t have ssh installed (or don’t have it within your search path).

You can clone from github via http, too:

Check if you have installed ssh-client . This solve the problem on docker machines, even when ssh keys are present:

Most likely your GIT_SSH_COMMAND is referencing the incorrect public key.

I had this issue right after my antivirus moved the cygwin ssh binary to virus vault, and restored it after.

  • SSH seems properly installed
  • SSH can be run from command line without problem

Another option before reinstalling ssh in this particular case: check the ssh command permissions

I am aware that it is an old topic, but having this problem recently, I want to bring here what I resolve my issue.

You might have this error on these conditions :

  • You use a URL like this : git@github.com:organization/repo.git
  • And you run a kind of command like this directly : git clone git@github.com/xxxxx.git whereas you don’t have ssh client (or it is not present on path)
  • Or you have an ssh client installed (and git clone xxx.git work fine on direct command line) but when you run the same kind of command through a shell script file

Here, I assume that you don’t want to change protocol ssh git@ to http:// ( git@github.com:organization/repo.git -> http://github.com/organization/repo.git ), like my case, cause I needed the ssh format.

  • If you do not have ssh client, first of all, you need to install it
  • If you have this error only when you execute it through a script, then you need to set GIT_SSH_COMMAND variable with your public ssh key, in front of your git command, like this :
Читайте также:  Как мышка apple работает с windows

(Feel free to change it depending on your context)

ssh client on Windows7 fails with: ssh_askpass: fork: No such file or directory #966

Comments

christian-korneck commented Nov 26, 2017 •

Please answer the following

«OpenSSH for Windows» version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
tested with versions 0.0.23.0 and 0.0.18.0

Server OperatingSystem
((Get-ItemProperty «HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\» -Name ProductName).ProductName)
any server on any OS — it’s a client issue (tested against various servers, both Linux and sshd on localhost running on Win7 SP1 Ultimate)

Client OperatingSystem
Windows 7 SP1 Ultimate

What is failing
On Windows 7, I can’t connect to any ssh server using the ssh.exe client from this project. The servers that I’ve tested all have password auth. The key error message is: ssh_askpass: fork: No such file or directory .

On Windows 10 (tested with Win10-1709) and on Windows 8.1, the same ssh.exe binary works as expected (connections against the same servers).
On the Windows 7 host, the same connections work using a different ssh client (i.e. putty ).
Same effect both with the 32bit and 64 bit ssh.exe .

I have tried ssh.exe both in version 0.0.23.0 and 0.0.18.0 (the version that ships as capability/optional feature in Win10-1709) without success.

Expected output

Actual output

The text was updated successfully, but these errors were encountered:

question

Unable to access the win10 PC with OpenSSH installed through ssh command

I have installed the OpenSSH client and server in my win10 PC through this website (https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse). However, when I tried to access the PC with ssh command through another PC, the ssh connection showed the error message with Permission denied, please try again. even if I entered the correct username and password. When I tried to access through administrator , the error message was Connection reset by xxx.xxx.xxx.xxx .

In order to verify this problem, I tried ssh command on the same PC. And the error message kept showing. But when I use ssh command to access another Linux PC, everything was working functionally.

Are there any other settings that need to be done with the OpenSSH server?

My OS is win10 Enterprise Edition LTSC ver. 1809 with 17763.1457

Hi @LiBai-8545 , thanks for the question.

Can you provide debug logs from the OpenSSH Server on the Windows 10 PC? For more on logging see here.

I’m just following up. Are you able to provide debug logs from your OpenSSH Server so we can drill down further into the issue?

Читайте также:  Драйвер hp scanjet 4070 photosmart scanner для windows

Thank you very much for the quick reply. I have tried the way you offered to me. There are two different outputs in the PowerShell: One is the non-administrator mode and the other is the administrator mode.

Administrator Mode

Server Side:

I am sorry the debug information is too long. And the reply box is limited by 1000 words. I will post the complete debug information in the answer box.

2 Answers

Here is the debug information on the server and client sides.

Administrator Mode PowerShell

Server Side

Client Side

Non-Administrator Mode PowerShell

Server Side:

Client Side

Thanks for the detailed logs. So a few things to try.

On the client try
ssh -v -p 23 LiBai@127.0.0.1

You don’t need to be in that directory nor do you need the ssh.exe. Secondly please ensure 127.0.0.1 is the valid IP address of the server machine and is accessible from the client.

If you still can’t get it to work after verifying above, it appears your having an issue with the authentication. This guide here shows how to setup a Windows SSH Server and connect to it with Linux. You should focus on the first half of the guide by ensuring you have the correct firewall rules in windows firewall (step 11) and read access. If you get this far and are still having issues, I’m confident it is a firewall or other authentication issue. Please let me know how this goes, I’d like to see you resolve this. 🙂

Hi @LiBai-8545 , just following up again as I haven’t heard if this helped you resolve your issue. Let me know where your at.

Thanks for your help. But I cannot find the sshd service in the Services Window.

Same problem. In my case I’m a college professor and I had my students set up sshd in order support an upcoming assignment where they need to examine the effect of setting file ACL permissions in one PowerShell window while setting them in another. About half of the students were successful. This is one of the problems that occurred in the other half. The students are all at a level past the Windows 10 1709 release running PowerShell 7 and their NetworkCategory is set to Private.

I stopped the sshd server to that I could run sshd manually as the traffic was not going to the other daemon.

stop-service sshd
sshd -d

Also not sure where the config files would go in Windows. There’s the hidden .ssh directory under $HOME in each user’s account — it currently only has one file known_hosts. And then there’s the \Windows\System32\Drivers\etc directory but this doesn’t have (at present) an ssh subdirectory.

Оцените статью