Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] lftp -u user,pass(word hw <hw@×××××.de>