Wrong Passphrase message while using encoded passphrase in script

Advertisement

s.salih@futurepipe.com
Joined:
Posts:
3

Wrong Passphrase message while using encoded passphrase in script

Hi
I am using private key authentication along with a passphrase in an automated script.
I prepared the connection command from the "Generate Session Code option" after which I replaced the special characters.(Password came encoded from the generated code itself). But still its showing Wrong passphrase.

open sftp://username::Fhjukp%24456@88.120.22.135:8022/ -privatekey="D:\Folder\privatekey.ppk" -hostkey="ssh-rsa 1024 MKA9n3CYF8dY+j9P713bUoWelyJtFdv8gNyuyiuyiuyiu" -passphrase="P%40%3Bq9KWI"
I changed the passphrase from P@;q9KWI to P%40%3Bq9KWI. - Is this correct
What I could be doing wrong here? Appreciate your assistance

SessionLog:
. 2019-09-10 17:06:35.563 Script: Retrospectively logging previous script records:
> 2019-09-10 17:06:35.563 Script: option echo off
< 2019-09-10 17:06:35.563 Script: echo off
> 2019-09-10 17:06:35.563 Script: option batch on
< 2019-09-10 17:06:35.563 Script: batch on
> 2019-09-10 17:06:35.563 Script: option confirm off
< 2019-09-10 17:06:35.563 Script: confirm off
> 2019-09-10 17:06:35.563 Script: open sftp://username::Fhjukp%24456@88.120.22.135:8022/ -privatekey="D:\FileShare\folder\Keys\folder_RSA_SSH_private.ppk" -hostkey="ssh-rsa 1024 MKA9n3CYF8dY+j9P713bUoWelyJtFdv8gNyuyiuyiuyiu" -passphrase="P%40%3Bq9KWI"
. 2019-09-10 17:06:35.563 --------------------------------------------------------------------------
. 2019-09-10 17:06:35.563 Session name: username@94.200.22.135 (Ad-Hoc site)
. 2019-09-10 17:06:35.563 Host name: 94.200.22.135 (Port: 8022)
. 2019-09-10 17:06:35.563 User name: username (Password: :Fhjukp$456, Key file: D:\FileShare\folder\Keys\folder_RSA_SSH_private.ppk, Passphrase: P%40%3Bq9KWI)
. 2019-09-10 17:06:35.564 Tunnel: No
. 2019-09-10 17:06:35.564 Transfer Protocol: SFTP
. 2019-09-10 17:06:35.564 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-09-10 17:06:35.564 Disable Nagle: No
. 2019-09-10 17:06:35.564 Proxy: None
. 2019-09-10 17:06:35.564 Send buffer: 262144
. 2019-09-10 17:06:35.564 SSH protocol version: 2; Compression: No
. 2019-09-10 17:06:35.564 Bypass authentication: No
. 2019-09-10 17:06:35.564 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-09-10 17:06:35.564 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2019-09-10 17:06:35.564 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-09-10 17:06:35.564 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-09-10 17:06:35.564 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-09-10 17:06:35.564 Simple channel: Yes
. 2019-09-10 17:06:35.564 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-09-10 17:06:35.564 Shell: default
. 2019-09-10 17:06:35.564 EOL: LF, UTF: Auto
. 2019-09-10 17:06:35.564 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-09-10 17:06:35.564 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2019-09-10 17:06:35.564 SFTP Bugs: Auto,Auto
. 2019-09-10 17:06:35.564 SFTP Server: default
. 2019-09-10 17:06:35.564 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-09-10 17:06:35.564 Cache directory changes: Yes, Permanent: Yes
. 2019-09-10 17:06:35.564 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2019-09-10 17:06:35.564 DST mode: Unix
. 2019-09-10 17:06:35.564 --------------------------------------------------------------------------
. 2019-09-10 17:06:35.564 Looking up host "94.200.22.135" for SSH connection
. 2019-09-10 17:06:35.564 Connecting to 94.200.22.135 port 8022
. 2019-09-10 17:06:35.711 We claim version: SSH-2.0-WinSCP_release_5.15.2
. 2019-09-10 17:06:35.865 Server version: SSH-2.0-GoAnywhere6.1.7
. 2019-09-10 17:06:35.865 Using SSH protocol version 2
. 2019-09-10 17:06:35.865 Have a known host key of type rsa2
. 2019-09-10 17:06:36.010 Doing ECDH key exchange with curve nistp256 and hash SHA-256
. 2019-09-10 17:06:36.245 Server also has ssh-dss host key, but we don't know it
. 2019-09-10 17:06:36.245 Host key fingerprint is:
. 2019-09-10 17:06:36.245 ssh-rsa 1024 20:dd:23:50:8d:69:23:9c:bd:2a:c3:18:91:fb:42:80 MKA9n3CYF8dY+j9P713bUoWelyJtFdv8gNpfn8pkzoc=
. 2019-09-10 17:06:36.245 Host key matches configured key
. 2019-09-10 17:06:36.246 Initialised AES-256 CBC client->server encryption
. 2019-09-10 17:06:36.246 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2019-09-10 17:06:36.246 Initialised AES-256 CBC server->client encryption
. 2019-09-10 17:06:36.246 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2019-09-10 17:06:36.754 Reading key file "D:\FileShare\folder\Keys\folder_RSA_SSH_private.ppk"
! 2019-09-10 17:06:36.754 Using username "username".
. 2019-09-10 17:06:36.901 Server offered these authentication methods: password,publickey,keyboard-interactive
. 2019-09-10 17:06:36.901 Offered public key
. 2019-09-10 17:06:37.052 Offer of public key accepted
! 2019-09-10 17:06:37.052 Authenticating with public key "rsa-key-20190905"
. 2019-09-10 17:06:37.052 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "rsa-key-20190905": ")
. 2019-09-10 17:06:37.052 Using configured passphrase.
! 2019-09-10 17:06:37.052 Wrong passphrase
. 2019-09-10 17:06:37.052 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "rsa-key-20190905": ")
. 2019-09-10 17:06:37.053 Disconnected: Unable to authenticate

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: Wrong Passphrase message while using encoded passphrase in script

Use the literal passphrase in the -passphrase switch. No URL encoding.

Reply with quote

s.salih@futurepipe.com
Joined:
Posts:
3

Re: Wrong Passphrase message while using encoded passphrase in script

martin wrote:

Use the literal passphrase in the -passphrase switch. No URL encoding.

Thank you. I was confused with the below statement in the Session log thinking that stored password doesnt work and it is still expecting the entry from keyboard. Can you please confirm that it is really possible to fully automated connection with passphrase embedded in the script file as some of your posts say that it isn't. FYI, I am using Winscp Portable 5.15.1.
Both Passowrd and Passphrase dont need encoding?

2019-09-10 17:06:37.052 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "rsa-key-20190905": ")

I will use the below command?

open sftp://username::Fhjukp$24456@88.120.22.135:8022/ -privatekey="D:\Folder\privatekey.ppk" -hostkey="ssh-rsa 1024 MKA9n3CYF8dY+j9P713bUoWelyJtFdv8gNyuyiuyiuyiu" -passphrase="P@,q9KWI"
.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: Wrong Passphrase message while using encoded passphrase in script

s.salih@futurepipe.com wrote:

Can you please confirm that it is really possible to fully automated connection with passphrase embedded in the script file as some of your posts say that it isn't.
I wouldn't be suggesting that, if it were not possible. What posts are you referring to?

Both Passowrd and Passphrase dont need encoding?
The password needs encoding, as it is a part of a session URL. The passphrase is not.
Though it's quite unlikely that you need both password and passphrase.

I will use the below command?

open sftp://username::Fhjukp$24456@88.120.22.135:8022/ -privatekey="D:\Folder\privatekey.ppk" -hostkey="ssh-rsa 1024 MKA9n3CYF8dY+j9P713bUoWelyJtFdv8gNyuyiuyiuyiu" -passphrase="P@,q9KWI"
.
Why don't you just try?
Though, yes, if you really need both passphrase and password.

Reply with quote

Advertisement

You can post new topics in this forum