Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lftp ignores ssl key-file when specified in batchfile #301

Closed
JohnLelii-CMCST opened this issue Dec 14, 2016 · 2 comments
Closed

lftp ignores ssl key-file when specified in batchfile #301

JohnLelii-CMCST opened this issue Dec 14, 2016 · 2 comments

Comments

@JohnLelii-CMCST
Copy link

JohnLelii-CMCST commented Dec 14, 2016

EXEC:
lftp -f batchfile

You can see the specified keyfile is never attempted with the remote server. Also behaves the same way with an interactive session and providing the same commands in sequence. A workaround is to sym link the ~/.ssh/id_rsa file to the specified keyfile.

Please confirm if this is resolved in a newer version. thanks.


DEBUG LOGGING:
[deploy_release] Running SFTP session now....
---- Running connect program (ssh -a -x -s -l sshacs sftp.host.com sftp)
---> sending a packet, length=5, type=1(INIT), id=0
<--- debug1: Connecting to [removed fqdn] port 22.
<--- debug1: Connection established.
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_rsa type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_rsa-cert type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_dsa type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_dsa-cert type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_ecdsa type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_ecdsa-cert type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_ed25519 type -1
<--- debug1: key_load_public: No such file or directory
<--- debug1: identity file /Users/jlelii/.ssh/id_ed25519-cert type -1
<--- debug1: Enabling compatibility mode for protocol 2.0
<--- debug1: Local version string SSH-2.0-OpenSSH_6.9
<--- debug1: Remote protocol version 1.99, remote software version Server-VIII-hpn14v2
<--- debug1: no match: Server-VIII-hpn14v2
<--- debug1: Authenticating to [fqdn removed]:22 as 'sshacs'
<--- debug1: SSH2_MSG_KEXINIT sent
<--- debug1: SSH2_MSG_KEXINIT received
<--- debug1: kex: server->client aes128-ctr umac-64@openssh.com none
<--- debug1: kex: client->server aes128-ctr umac-64@openssh.com none
<--- debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
<--- debug1: Server host key: ssh-dss SHA256:LuRyAk8LZhLaIxYvzZRKDRzrToKlYFmCoPcgXRJTpKM
<--- debug1: Host '[fqdn removed]' is known and matches the DSA host key.
<--- debug1: Found key in /Users/jlelii/.ssh/known_hosts:1
<--- debug1: SSH2_MSG_NEWKEYS sent
<--- debug1: expecting SSH2_MSG_NEWKEYS
<--- debug1: SSH2_MSG_NEWKEYS received
<--- debug1: SSH2_MSG_SERVICE_REQUEST sent
<--- debug1: SSH2_MSG_SERVICE_ACCEPT received
<--- debug1: Authentications that can continue: publickey
<--- debug1: Next authentication method: publickey
<--- debug1: Trying private key: /Users/jlelii/.ssh/id_rsa
<--- debug1: Trying private key: /Users/jlelii/.ssh/id_dsa
<--- debug1: Trying private key: /Users/jlelii/.ssh/id_ecdsa
<--- debug1: Trying private key: /Users/jlelii/.ssh/id_ed25519
<--- debug1: No more authentication methods to try.
<--- Permission denied (publickey).
**** Peer closed connection
**** Permission denied (publickey).
---- Disconnecting
cd `INT' [Permission denied (publickey).]
^C
jlelii$

BATCHFILE EXAMPLE:
set ssl:key-file /Users/jlelii/.ssh/id_rsa_someotherkeyfile
debug
open -u user,ignoreme sftp://sftp.host.com
cd INT
bye

VERSIONS affected:

  1. Mac OSX, 10.11.6
    LFTP | Version 4.6.6 | Copyright (c) 1996-2015 Alexander V. Lukyanov
    Libraries used: Readline 7.0, Expat 2.1.0, OpenSSL 1.0.2j 26 Sep 2016, libiconv 1.11, zlib 1.2.5

  2. Linux kernel 4.4.x, Mint 18.0
    LFTP | Version 4.6.3a | Copyright (c) 1996-2014 Alexander V. Lukyanov
    Libraries used: Readline 6.3, GnuTLS 3.4.10, zlib 1.2.8

@lavv17
Copy link
Owner

lavv17 commented Dec 15, 2016

You have to specify the ssh key file in the sftp:connect-program setting like this:
set sftp:connect-program "ssh -x -i key-file"

@lavv17 lavv17 closed this as completed in 225f684 Dec 15, 2016
@JohnLelii-CMCST
Copy link
Author

thank you for your response and updating the documentation. Works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants