Gentoo Archives: gentoo-user

From: hw <hw@×××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] lftp -u user,pass(word
Date: Fri, 08 Apr 2016 13:05:58
Message-Id: 5707ACA9.5040002@gc-24.de
In Reply to: Re: [gentoo-user] lftp -u user,pass(word by Neil Bothwick
1 Neil Bothwick schrieb:
2 > On Wed, 6 Apr 2016 10:14:40 +0200, hw wrote:
3 >
4 >> Mick schrieb:
5 >>> On Tuesday 05 Apr 2016 20:06:08 hw wrote:
6 >>>> Neil Bothwick schrieb:
7 >>>>> On Tue, 5 Apr 2016 14:43:25 +0200, hw wrote:
8 >>>>>> how do you use lftp (to mirror a remote site)
9 >>>>>> when the password you have contains a bracket?
10 >>>>>>
11 >>>>>> I'm trying 'lftp -u user,pass(word ftp.example.com', and
12 >>>>>> there appears to be no way to escape characters in the
13 >>>>>> password. Using single quotes also doesn't work, same
14 >>>>>> as 'lftp 'ftp://user:pass(word@×××××××.com'.
15 >>>>>
16 >>>>> Try lftp 'ftp://user:pass\(word@×××××××.com'
17 >>>>> or lftp ftp://user:pass\\\(word@×××××××.com
18 >>>>>
19 >>>>> The \ escapes the ( and the single quotes protect it fro the shell.
20 >>>>> In the second way, you escape the \ as well.
21 >>>>
22 >>>> That's what I thought :) I already tried and it didn't
23 >>>> work.
24 >>>
25 >>> Did you try putting single/double quotes around passwd only?
26 >>>
27 >>
28 >> Yes, that didn't work, either.
29 >
30 > I had a quick look at the man page and it says that parentheses can be
31 > used to group commands, so maybe lftp is misinterpreting the ( in this
32 > way.
33 >
34 > However, the man page also advises against giving the password on the
35 > command line (because it is then available to anyone with normal user
36 > shell access while the command is running) and suggests using either
37
38 I need to use it with a script for automatic downloads, so the password
39 wouldn't appear in the history. Using a ~/.netrc would create a
40 dependency on the user who runs the script, which is something I would
41 prefer to avoid.
42
43 > ~/.netrc, which you have already said works, or $LFTP_PASSWORD along
44 > with --env-password. Have you tried this?
45 >
46 > LFTP_PASSWORD='pass(word' lftp --env-password -u user ftp://example.com
47
48 Thanks, that looks like a good solution. I'll see if that works ...

Replies

Subject Author
Re: [gentoo-user] lftp -u user,pass(word Neil Bothwick <neil@××××××××××.uk>