Alexander V. Lukyanov
2013-04-09 09:22:06 UTC
1. I cannot specify the protocol (for example, sftp) to use on the command line.
I'm trying to use lftp to issue the 'du' command to the remote host
non-interactively, as follows: "echo "du -sk ." | lftp -u myuser,mypass host".
This works, but does not use the sftp protocol.
2. -c does not behave like -c, although, according to the man page, it should.
It does, but it does not accept extra options. I.e. all arguments after -cI'm trying to use lftp to issue the 'du' command to the remote host
non-interactively, as follows: "echo "du -sk ." | lftp -u myuser,mypass host".
This works, but does not use the sftp protocol.
2. -c does not behave like -c, although, according to the man page, it should.
is the command.
lftp -c 'du -sk .' -u myuser,pass myhost
Unknown command `du -sk .'.
You should use this:Unknown command `du -sk .'.
lftp -c 'open -u myuser,pass myhost && du -sk .'
3. I can't specify an ssh identity-key on the command line, but only in the
config file
You can specify it using -e option:config file
lftp -e "set ssl:key-file /root/.ssh/backup_key" -u myuser,pass myhost
4. sftp seems to fail to establish a connection, even though I think I'm doing
echo "open sftp://myhost && du -sk ." | lftp -u myuser
that is not protected by a passphrase.
It asks for password always when there us a user name. If you authenticateecho "open sftp://myhost && du -sk ." | lftp -u myuser
lftp :~> open sftp://myhost
lftp myhost:~> user myuser
Password: <CR>
---- Running connect program (ssh -a -x -s -l myuser myhost sftp)
---> sending a packet, length=5, type=1(INIT), id=0
<--- Permission denied, please try again.
---- Disconnecting
ls: Login failed: Login incorrect
imho, it should be asking me for a password if I have supplied a private keylftp myhost:~> user myuser
Password: <CR>
---- Running connect program (ssh -a -x -s -l myuser myhost sftp)
---> sending a packet, length=5, type=1(INIT), id=0
<--- Permission denied, please try again.
---- Disconnecting
ls: Login failed: Login incorrect
that is not protected by a passphrase.
without password, just hit enter or specify an empty password in the
command line.
BTW, ssh cannot authenticate by lftp's setting ssl:key-file. You should
use this:
set sftp:connect-program "ssh -a -x -i /root/.ssh/backup_key"
HTH.
--
Alexander.
Alexander.