bramvdbogaerde / go-scp

Simple Golang scp client
Mozilla Public License 2.0
418 stars 87 forks source link

scp: Invalid options #62

Open jondunning opened 2 years ago

jondunning commented 2 years ago

Hi,

Receiving the following error message when trying to CopyFromFile to remote device;

scp: Invalid options

Can't seem to work out why it's not working, any ideas?

jondunning commented 2 years ago

If I change the following line in client.go from

err := a.Session.Run(fmt.Sprintf("%s -qt %q", a.RemoteBinary, remotePath))

to

err := a.Session.Run(fmt.Sprintf("%s -t %q", a.RemoteBinary, remotePath))

it works

bramvdbogaerde commented 2 years ago

Thanks for reporting.

Could you provide some information about the remote system (such as OS)? Thanks.

jondunning commented 2 years ago

Yes sure, it’s a digi transport wr21 router.

https://www.digi.com/resources/documentation/Digidocs/pdfs/90001019.pdf

It also doesn’t like having the file name wrapped in quotes. The file actually gets added to the router with the quotes retained. For example, should be config.da0 but ends up “config.da0”.

nemith commented 7 months ago

Same problem with Junos (FreeBSD) devices.

nemith commented 6 months ago

Sorry Cisco / NX-OS devices.