pkg/sftp fails connecting (special char in user/pass)

170 views
Skip to first unread message

Pontus Lundin

unread,
Nov 4, 2016, 10:28:43 AM11/4/16
to golang-nuts

Hi!

Having successfully connected to many sftp servers before now having problem with one a using password auth.


ssh -vv yields
debug1: Next authentication method: password
password:


The user and password contains a $ character, i have tried encode it '%24' and in plain text. If having plain string the result is:

failed to send packet header: EOF


if using escaped character the result is:

Failed to dial: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
exit status 1


Using ssh works, however ends with

PTY allocation request failed on channel 0
Terminal access is disabled for this site
Connection to xxxxxx closed

if that is something.


Any ideas on this one ?
Thanks!

Derbyshire, Drew

unread,
Nov 4, 2016, 1:42:13 PM11/4/16
to Pontus Lundin, golang-nuts
my advice: Don't use dollar signs. That's tempting fate, like using a quote or newline character.

I suspect one of the values is being used in a shell context and being expanded.

Why are they being used in the first place?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Drew Derbyshire
Assistant Cat Valet (Probationary)
Telephone 425-318-4350

Pontus Lundin

unread,
Nov 4, 2016, 3:01:49 PM11/4/16
to golang-nuts, lundin....@gmail.com
Hi! Thanks. I agree, that was my thinking as well..i just got it from the server/sftp provider. I dont think they are meant and used for anything special.. it just feels wired to be honest :/
Will try to change that to start with.


Den fredag 4 november 2016 kl. 18:42:13 UTC+1 skrev Drew Derbyshire:
my advice: Don't use dollar signs. That's tempting fate, like using a quote or newline character.

I suspect one of the values is being used in a shell context and being expanded.

Why are they being used in the first place?
On Fri, Nov 4, 2016 at 7:28 AM, Pontus Lundin <lundin....@gmail.com> wrote:

Hi!

Having successfully connected to many sftp servers before now having problem with one a using password auth.


ssh -vv yields
debug1: Next authentication method: password
password:


The user and password contains a $ character, i have tried encode it '%24' and in plain text. If having plain string the result is:

failed to send packet header: EOF


if using escaped character the result is:

Failed to dial: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
exit status 1


Using ssh works, however ends with

PTY allocation request failed on channel 0
Terminal access is disabled for this site
Connection to xxxxxx closed

if that is something.


Any ideas on this one ?
Thanks!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Pontus Lundin

unread,
Nov 4, 2016, 5:11:19 PM11/4/16
to golang-nuts
Now solved, was my misstake with walking some fs path that produced the unexpected error. Just walking and creating files at ~ solved it.
Sorry sorry. The sftp package is solid and great!
Reply all
Reply to author
Forward
0 new messages