Re: [gentoo-user] lftp -u user,pass(word

2016-04-08 Thread Mick
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

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] lftp -u user,pass(word

2016-04-08 Thread Neil Bothwick
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.


pgpH6y5rfkbIx.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] lftp -u user,pass(word

2016-04-08 Thread hw

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(w...@example.com'.


Try lftp 'ftp://user:pass\(w...@example.com'
or  lftp ftp://user:pass\\\(w...@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 ...




Re: [gentoo-user] lftp -u user,pass(word

2016-04-06 Thread Neil Bothwick
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(w...@example.com'.  
> >>>
> >>> Try lftp 'ftp://user:pass\(w...@example.com'
> >>> or  lftp ftp://user:pass\\\(w...@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?"


pgpz1gmpFOspG.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] lftp -u user,pass(word

2016-04-06 Thread hw

J. Roeleveld schrieb:

On April 5, 2016 8:06:08 PM GMT+02:00, 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(w...@example.com'.


Try lftp 'ftp://user:pass\(w...@example.com'
or  lftp ftp://user:pass\\\(w...@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 ...





Re: [gentoo-user] lftp -u user,pass(word

2016-04-06 Thread hw

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(w...@example.com'.


Try lftp 'ftp://user:pass\(w...@example.com'
or  lftp ftp://user:pass\\\(w...@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.




Re: [gentoo-user] lftp -u user,pass(word

2016-04-05 Thread J. Roeleveld
On April 5, 2016 8:06:08 PM GMT+02:00, 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(w...@example.com'.
>>
>> Try lftp 'ftp://user:pass\(w...@example.com'
>> or  lftp ftp://user:pass\\\(w...@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.



Re: [gentoo-user] lftp -u user,pass(word

2016-04-05 Thread Mick
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(w...@example.com'.
> > 
> > Try lftp 'ftp://user:pass\(w...@example.com'
> > or  lftp ftp://user:pass\\\(w...@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

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] lftp -u user,pass(word

2016-04-05 Thread hw

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(w...@example.com'.


Try lftp 'ftp://user:pass\(w...@example.com'
or  lftp ftp://user:pass\\\(w...@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.





Re: [gentoo-user] lftp -u user,pass(word

2016-04-05 Thread Neil Bothwick
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(w...@example.com'.

Try lftp 'ftp://user:pass\(w...@example.com'
or  lftp ftp://user:pass\\\(w...@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.


pgpyVNf5dOIzg.pgp
Description: OpenPGP digital signature