Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cisco compatible SCP #108

Closed
bazauto opened this issue Nov 2, 2016 · 11 comments
Closed

Cisco compatible SCP #108

bazauto opened this issue Nov 2, 2016 · 11 comments
Assignees
Labels

Comments

@bazauto
Copy link

bazauto commented Nov 2, 2016

I've been working with the Posh-SSH PowerShell module, which uses this library, to transfer files to/from Cisco devices via SCP. With the Cisco devices as the SCP server. Currently testing with a 2801 router running IOS 12.4(24)T1.

We also have newer routers running 15.4 but I have not had chance to test one of those yet.

I've found that the Cisco scp process interprets the quotes added around the filename as part of the filename. If I remove the quotes the file transfer works as expected.

I changed...

channel.SendExecRequest(string.Format("scp -t {0}", pathOnly));

to ...

channel.SendExecRequest(string.Format("scp -t \"{0}\"", pathOnly));

It is also worth noting, I'm using the stream based overrides as the Cisco scp process doesn't support the "-p, -r or -d" options.

Is this something you would consider adding compatibility for? Would you like me to propose a solution in a pull request?

@cocowalla
Copy link

I've had the same problem with Cisco devices - would be nice to get a fix merged in.

@drieseng drieseng self-assigned this Aug 19, 2017
@drieseng drieseng added the bug label Aug 19, 2017
@drieseng drieseng added this to the 2016.1.0-beta3 milestone Aug 19, 2017
@drieseng
Copy link
Member

@cocowalla @bazauto
Do you guys have a device that I can test a fix against?

@darkoperator
Copy link

darkoperator commented Aug 20, 2017 via email

@bazauto
Copy link
Author

bazauto commented Aug 22, 2017

I can setup a publicly accessible Cisco device, but it will be next week, if that is any use.

@drieseng
Copy link
Member

drieseng commented Aug 25, 2017

@bazauto Yes, that would definitely be useful. Thanks!

@drieseng
Copy link
Member

In PR #290 I've introduced a mechanism to disable path quoting, and at the same time we now allow for a custom quoting implementation to be plugged in.

That PR (and the develop branch) also features a new default quoting implementation.
More info on this implementation is available here.

Can you build SSH.NET from the scp-quoting branch and:

  • Try using the new default quoting implementation to see if that works for CISCO routers.
  • If not, try using the None transformation to disable quoting altogether.

Please perform tests with both "regular" paths, and paths with spaces and special characters (#<>;%?'" ...).

@cocowalla
Copy link

@bazauto best not to post credentials publically! You should probably delete your comment and send to @drieseng at gertdriesen@msn.com!

@sshnet sshnet deleted a comment from bazauto Aug 30, 2017
@drieseng
Copy link
Member

@bazauto I removed your comment. You may want to modify the password, and send it to me privately.

@bazauto
Copy link
Author

bazauto commented Aug 30, 2017

@drieseng I've changed the password and sent you the new details via e-mail.

Clearly not thinking straight this morning.

drieseng added a commit that referenced this issue Sep 9, 2017
Introduce extensible remote path quoting mechanism.
Fixes issues #256 and #108.
@drieseng
Copy link
Member

drieseng commented Sep 9, 2017

With the None remote path transformation that landed into the develop branch as part of PR #290, I was able to upload and download files that do not contain any special characters.

As I mentioned in my email, I did not find a way to download or upload files from a path containing spaces. The Cisco router does not appear to support any quoting mechanism.

Please reopen this issue if you have more information.

@drieseng drieseng closed this as completed Sep 9, 2017
@drieseng
Copy link
Member

I've just released version 2016.1.0-beta3 of SSH.NET, which includes a fix for this issue.
Please use either the source, binary or NuGet distribution to confirm this version resolves the reported problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants