scp.py
scp.py copied to clipboard
SCPException Protocol not available while getting from Windows
I'm trying to get a file from Windows 10 with OpenSSH running to my Macbook. I'm getting the following error whereas the same command works fine on my terminal.
This works fine -
scp [email protected]:C:/Users/labuser/ScreenCaptureUtil/Screenshots/Thanos.png /Users/skynet/Downloads/Temporary/
This doesn't work -
ssh = createSSHClient(my_ip, 22, "labuser", "P@ssword1")
scp = SCPClient(ssh.get_transport())
scp.get(r"C:\Users\labuser\ScreenCaptureUtil\Screenshots\Thanos.png", r"/Users/skynet/Downloads/Temporary")
Gives me the exception-
Traceback (most recent call last):
File "/Users/skynet/Documents/code/ScratchPad/Paramiko.py", line 14, in <module>
scp.get(r"C:\Users\labuser\ScreenCaptureUtil\Screenshots\Thanos.png", r"/Users/skynet/Downloads/Temporary")
File "/Users/skynet/.virtualenvs/venv_e2e_python3/lib/python3.7/site-packages/scp.py", line 238, in get
self._recv_all()
File "/Users/skynet/.virtualenvs/venv_e2e_python3/lib/python3.7/site-packages/scp.py", line 388, in _recv_all
raise SCPException(asunicode(msg[1:]))
scp.SCPException: scp: 'C:/Users/labuser/ScreenCaptureUtil/Screenshots/Thanos.png': Protocol not available
Seems like some kind of quoting issue. Do you mind sharing what kind of server you're using on the Windows side?
Yes, its the OpenSSH
one shipped with the latest Windows.
https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview
This is the output -
sshd -V unknown option -- V OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4