19

can you please help me

when I run this in terminal : scp -p -P 29418 michealvern.genzola@192.168.0.122:hooks/commit-msg "jyei-erp/.git/hooks/"

it says : subsystem request failed on channel 0 scp: Connection closed

someone help me

Michael Vern
  • 201
  • 1
  • 1
  • 3

3 Answers3

43

Try -O as an option in your scp cmd, i.e.

scp -p -O -P 29418 michealvern.genzola@192.168.0.122:hooks/commit-msg "jyei-erp/.git/hooks/"

Faced similar issue. This solution is from comments in github regarding this problem. For more details - https://github.com/PowerShell/Win32-OpenSSH/issues/1945

psybrg
  • 689
  • 5
  • 7
19

Got the exact symptom on Linux. Giving -O fixed the issue. From scp manpage

     -O      Use the original SCP protocol for file transfers instead of the SFTP protocol.  Forcing the use of the
             SCP protocol may be necessary for servers that do not implement SFTP, for backwards-compatibility for
             particular filename wildcard patterns and for expanding paths with a ‘~’ prefix for older SFTP servers.
j3ffyang
  • 1,049
  • 12
  • 12
5

I was also facing this issue, adding -O flag fixed my issue as said by @pysbrg already above, final command:

scp -p -O -P 29418 michealvern.genzola@192.168.0.122:hooks/commit-msg "jyei-erp/.git/hooks/"
Saurav Gami
  • 61
  • 1
  • 3