public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] lftp -u user,pass(word
@ 2016-04-05 12:43 hw
  2016-04-05 12:52 ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: hw @ 2016-04-05 12:43 UTC (permalink / raw
  To: gentoo-user


Hi,

how do you use lftp (to mirror a remote site)
when the password you have contains a bracket?

I'm trying 'lftp -u user,pass(word ftp.example.com', and
there appears to be no way to escape characters in the
password.  Using single quotes also doesn't work, same
as 'lftp 'ftp://user:pass(word@example.com'.

It works with an entry in ~/.netrc, though I don't
exactly want to have to use that.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-05 12:43 [gentoo-user] lftp -u user,pass(word hw
@ 2016-04-05 12:52 ` Neil Bothwick
  2016-04-05 18:06   ` hw
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2016-04-05 12:52 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:

> how do you use lftp (to mirror a remote site)
> when the password you have contains a bracket?
> 
> I'm trying 'lftp -u user,pass(word ftp.example.com', and
> there appears to be no way to escape characters in the
> password.  Using single quotes also doesn't work, same
> as 'lftp 'ftp://user:pass(word@example.com'.

Try lftp 'ftp://user:pass\(word@example.com'
or  lftp ftp://user:pass\\\(word@example.com

The \ escapes the ( and the single quotes protect it fro the shell. In
the second way, you escape the \ as well.


-- 
Neil Bothwick

In plumbing, a straight flush is better than a full house.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-05 12:52 ` Neil Bothwick
@ 2016-04-05 18:06   ` hw
  2016-04-05 18:09     ` Mick
  2016-04-05 18:09     ` J. Roeleveld
  0 siblings, 2 replies; 11+ messages in thread
From: hw @ 2016-04-05 18:06 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick schrieb:
> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
>
>> how do you use lftp (to mirror a remote site)
>> when the password you have contains a bracket?
>>
>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
>> there appears to be no way to escape characters in the
>> password.  Using single quotes also doesn't work, same
>> as 'lftp 'ftp://user:pass(word@example.com'.
>
> Try lftp 'ftp://user:pass\(word@example.com'
> or  lftp ftp://user:pass\\\(word@example.com
>
> The \ escapes the ( and the single quotes protect it fro the shell. In
> the second way, you escape the \ as well.

That's what I thought :)  I already tried and it didn't
work.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-05 18:06   ` hw
@ 2016-04-05 18:09     ` Mick
  2016-04-06  8:14       ` hw
  2016-04-05 18:09     ` J. Roeleveld
  1 sibling, 1 reply; 11+ messages in thread
From: Mick @ 2016-04-05 18:09 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

On Tuesday 05 Apr 2016 20:06:08 hw wrote:
> Neil Bothwick schrieb:
> > On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
> >> how do you use lftp (to mirror a remote site)
> >> when the password you have contains a bracket?
> >> 
> >> I'm trying 'lftp -u user,pass(word ftp.example.com', and
> >> there appears to be no way to escape characters in the
> >> password.  Using single quotes also doesn't work, same
> >> as 'lftp 'ftp://user:pass(word@example.com'.
> > 
> > Try lftp 'ftp://user:pass\(word@example.com'
> > or  lftp ftp://user:pass\\\(word@example.com
> > 
> > The \ escapes the ( and the single quotes protect it fro the shell. In
> > the second way, you escape the \ as well.
> 
> That's what I thought :)  I already tried and it didn't
> work.

Did you try putting single/double quotes around passwd only?

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-05 18:06   ` hw
  2016-04-05 18:09     ` Mick
@ 2016-04-05 18:09     ` J. Roeleveld
  2016-04-06  8:15       ` hw
  1 sibling, 1 reply; 11+ messages in thread
From: J. Roeleveld @ 2016-04-05 18:09 UTC (permalink / raw
  To: gentoo-user

On April 5, 2016 8:06:08 PM GMT+02:00, hw <hw@gc-24.de> wrote:
>Neil Bothwick schrieb:
>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
>>
>>> how do you use lftp (to mirror a remote site)
>>> when the password you have contains a bracket?
>>>
>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
>>> there appears to be no way to escape characters in the
>>> password.  Using single quotes also doesn't work, same
>>> as 'lftp 'ftp://user:pass(word@example.com'.
>>
>> Try lftp 'ftp://user:pass\(word@example.com'
>> or  lftp ftp://user:pass\\\(word@example.com
>>
>> The \ escapes the ( and the single quotes protect it fro the shell.
>In
>> the second way, you escape the \ as well.
>
>That's what I thought :)  I already tried and it didn't
>work.

Have you tried:
lftp -u "user,pass(word" ftp.example.com
?

Maybe that works.

--
Joost 
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-05 18:09     ` Mick
@ 2016-04-06  8:14       ` hw
  2016-04-06  8:58         ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: hw @ 2016-04-06  8:14 UTC (permalink / raw
  To: gentoo-user

Mick schrieb:
> On Tuesday 05 Apr 2016 20:06:08 hw wrote:
>> Neil Bothwick schrieb:
>>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
>>>> how do you use lftp (to mirror a remote site)
>>>> when the password you have contains a bracket?
>>>>
>>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
>>>> there appears to be no way to escape characters in the
>>>> password.  Using single quotes also doesn't work, same
>>>> as 'lftp 'ftp://user:pass(word@example.com'.
>>>
>>> Try lftp 'ftp://user:pass\(word@example.com'
>>> or  lftp ftp://user:pass\\\(word@example.com
>>>
>>> The \ escapes the ( and the single quotes protect it fro the shell. In
>>> the second way, you escape the \ as well.
>>
>> That's what I thought :)  I already tried and it didn't
>> work.
>
> Did you try putting single/double quotes around passwd only?
>

Yes, that didn't work, either.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-05 18:09     ` J. Roeleveld
@ 2016-04-06  8:15       ` hw
  0 siblings, 0 replies; 11+ messages in thread
From: hw @ 2016-04-06  8:15 UTC (permalink / raw
  To: gentoo-user

J. Roeleveld schrieb:
> On April 5, 2016 8:06:08 PM GMT+02:00, hw <hw@gc-24.de> wrote:
>> Neil Bothwick schrieb:
>>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
>>>
>>>> how do you use lftp (to mirror a remote site)
>>>> when the password you have contains a bracket?
>>>>
>>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
>>>> there appears to be no way to escape characters in the
>>>> password.  Using single quotes also doesn't work, same
>>>> as 'lftp 'ftp://user:pass(word@example.com'.
>>>
>>> Try lftp 'ftp://user:pass\(word@example.com'
>>> or  lftp ftp://user:pass\\\(word@example.com
>>>
>>> The \ escapes the ( and the single quotes protect it fro the shell.
>> In
>>> the second way, you escape the \ as well.
>>
>> That's what I thought :)  I already tried and it didn't
>> work.
>
> Have you tried:
> lftp -u "user,pass(word" ftp.example.com
> ?
>
> Maybe that works.

I tried that, too, no dice ...




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-06  8:14       ` hw
@ 2016-04-06  8:58         ` Neil Bothwick
  2016-04-08 13:05           ` hw
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2016-04-06  8:58 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]

On Wed, 6 Apr 2016 10:14:40 +0200, hw wrote:

> Mick schrieb:
> > On Tuesday 05 Apr 2016 20:06:08 hw wrote:  
> >> Neil Bothwick schrieb:  
> >>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:  
> >>>> how do you use lftp (to mirror a remote site)
> >>>> when the password you have contains a bracket?
> >>>>
> >>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
> >>>> there appears to be no way to escape characters in the
> >>>> password.  Using single quotes also doesn't work, same
> >>>> as 'lftp 'ftp://user:pass(word@example.com'.  
> >>>
> >>> Try lftp 'ftp://user:pass\(word@example.com'
> >>> or  lftp ftp://user:pass\\\(word@example.com
> >>>
> >>> The \ escapes the ( and the single quotes protect it fro the shell.
> >>> In the second way, you escape the \ as well.  
> >>
> >> That's what I thought :)  I already tried and it didn't
> >> work.  
> >
> > Did you try putting single/double quotes around passwd only?
> >  
> 
> Yes, that didn't work, either.

I had a quick look at the man page and it says that parentheses can be
used to group commands, so maybe lftp is misinterpreting the ( in this
way.

However, the man page also advises against giving the password on the
command line (because it is then available to anyone with normal user
shell access while the command is running) and suggests using either
~/.netrc, which you have already said works, or $LFTP_PASSWORD along
with --env-password. Have you tried this?

LFTP_PASSWORD='pass(word' lftp --env-password -u user ftp://example.com


-- 
Neil Bothwick

Isn't it a bit unnerving that doctors call what they do "practice?"

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-06  8:58         ` Neil Bothwick
@ 2016-04-08 13:05           ` hw
  2016-04-08 13:17             ` Neil Bothwick
  0 siblings, 1 reply; 11+ messages in thread
From: hw @ 2016-04-08 13:05 UTC (permalink / raw
  To: gentoo-user

Neil Bothwick schrieb:
> On Wed, 6 Apr 2016 10:14:40 +0200, hw wrote:
>
>> Mick schrieb:
>>> On Tuesday 05 Apr 2016 20:06:08 hw wrote:
>>>> Neil Bothwick schrieb:
>>>>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
>>>>>> how do you use lftp (to mirror a remote site)
>>>>>> when the password you have contains a bracket?
>>>>>>
>>>>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
>>>>>> there appears to be no way to escape characters in the
>>>>>> password.  Using single quotes also doesn't work, same
>>>>>> as 'lftp 'ftp://user:pass(word@example.com'.
>>>>>
>>>>> Try lftp 'ftp://user:pass\(word@example.com'
>>>>> or  lftp ftp://user:pass\\\(word@example.com
>>>>>
>>>>> The \ escapes the ( and the single quotes protect it fro the shell.
>>>>> In the second way, you escape the \ as well.
>>>>
>>>> That's what I thought :)  I already tried and it didn't
>>>> work.
>>>
>>> Did you try putting single/double quotes around passwd only?
>>>
>>
>> Yes, that didn't work, either.
>
> I had a quick look at the man page and it says that parentheses can be
> used to group commands, so maybe lftp is misinterpreting the ( in this
> way.
>
> However, the man page also advises against giving the password on the
> command line (because it is then available to anyone with normal user
> shell access while the command is running) and suggests using either

I need to use it with a script for automatic downloads, so the password
wouldn't appear in the history.  Using a ~/.netrc would create a
dependency on the user who runs the script, which is something I would
prefer to avoid.

> ~/.netrc, which you have already said works, or $LFTP_PASSWORD along
> with --env-password. Have you tried this?
>
> LFTP_PASSWORD='pass(word' lftp --env-password -u user ftp://example.com

Thanks, that looks like a good solution.  I'll see if that works ...



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-08 13:05           ` hw
@ 2016-04-08 13:17             ` Neil Bothwick
  2016-04-08 20:28               ` Mick
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2016-04-08 13:17 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Fri, 8 Apr 2016 15:05:45 +0200, hw wrote:

> > However, the man page also advises against giving the password on the
> > command line (because it is then available to anyone with normal user
> > shell access while the command is running) and suggests using either  
> 
> I need to use it with a script for automatic downloads, so the password
> wouldn't appear in the history.  Using a ~/.netrc would create a
> dependency on the user who runs the script, which is something I would
> prefer to avoid.

It's not just the history, the password appears in the putput from ps
while the transfer is running.

> > ~/.netrc, which you have already said works, or $LFTP_PASSWORD along
> > with --env-password. Have you tried this?
> >
> > LFTP_PASSWORD='pass(word' lftp --env-password -u user
> > ftp://example.com  
> 
> Thanks, that looks like a good solution.  I'll see if that works ...

If that doesn't work, you could always sidestep the issue by changing the
password to "password1" ;-)


-- 
Neil Bothwick

Programmer (n): A red-eyed, mumbling mammal capable of conversing
with inanimate objects.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user] lftp -u user,pass(word
  2016-04-08 13:17             ` Neil Bothwick
@ 2016-04-08 20:28               ` Mick
  0 siblings, 0 replies; 11+ messages in thread
From: Mick @ 2016-04-08 20:28 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]

On Friday 08 Apr 2016 14:17:21 Neil Bothwick wrote:
> On Fri, 8 Apr 2016 15:05:45 +0200, hw wrote:
> > > However, the man page also advises against giving the password on the
> > > command line (because it is then available to anyone with normal user
> > > shell access while the command is running) and suggests using either
> > 
> > I need to use it with a script for automatic downloads, so the password
> > wouldn't appear in the history.  Using a ~/.netrc would create a
> > dependency on the user who runs the script, which is something I would
> > prefer to avoid.
> 
> It's not just the history, the password appears in the putput from ps
> while the transfer is running.
> 
> > > ~/.netrc, which you have already said works, or $LFTP_PASSWORD along
> > > with --env-password. Have you tried this?
> > > 
> > > LFTP_PASSWORD='pass(word' lftp --env-password -u user
> > > ftp://example.com
> > 
> > Thanks, that looks like a good solution.  I'll see if that works ...
> 
> If that doesn't work, you could always sidestep the issue by changing the
> password to "password1" ;-)

I remember banging my head against a brick wall trying similar methods to get 
ssmtp to use a passwd with special characters.  It would only accept 
alphanumeric characters.  I wasn't sure if this was a bash or an ssmtp 
problem.  I ended up changing the passwd.  :-(

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-04-08 20:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 12:43 [gentoo-user] lftp -u user,pass(word hw
2016-04-05 12:52 ` Neil Bothwick
2016-04-05 18:06   ` hw
2016-04-05 18:09     ` Mick
2016-04-06  8:14       ` hw
2016-04-06  8:58         ` Neil Bothwick
2016-04-08 13:05           ` hw
2016-04-08 13:17             ` Neil Bothwick
2016-04-08 20:28               ` Mick
2016-04-05 18:09     ` J. Roeleveld
2016-04-06  8:15       ` hw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox