:ERROR #7510: SSH Error '-18': SSH Error [80101012]: Username/PublicKey combination invalid [80101012] at Session.cpp:458,0
Hi,
I try SFTP connect by ObjectScript.
But occurred this error. Can't connect by SFTP key-pair authentication.
:ERROR #7510: SSH Error '-18': SSH Error [80101012]: Username/PublicKey combination invalid [80101012] at Session.cpp:458,0
Key pair was generate this way.
ssh-keygen -m pem -f ~/.ssh/id_rsa
"id_rsa" and "id_rsa.pub" is generated.
Passphrase is empty.
sftp command is connect successful.
ex.
sftp -i .ssh/id_rsa sftpuser@localhost
And other SFTP client is connect successful too.
ex. Fillezilla.
And password authentication is successful too.
ObjectScript code is this.
ClassMethod SFTPDir() As %Status { set ssh = ##class(%Net.SSH.Session).%New() Do ssh.SetTraceMask(511,"/tmp/ssh.log") Set sc = ssh.Connect("localhost") Write:$$$ISERR(sc) "Connect:", $System.Status.GetErrorText(sc),! Set sc = ssh.AuthenticateWithKeyPair("sftpuser","/path/to/id_rsa.pub","/path/to/id_rsa","")Set sc = ssh.AuthenticateWithUsername("sftpuser","/path/to/id_rsa.pub","/path/to/p_id_rsa","")//Set sc = ssh.AuthenticateWithUsername("sftpuser","password") //success//Set sc = ssh.AuthenticateWithKeyPair("sftpuser","password") //successWrite:$$$ISERR(sc) "AuthenticateWithKeyPair:", $System.Status.GetErrorText(sc),! Set sc = ssh.OpenSFTP(.sftp) Write:$$$ISERR(sc) "OpenSFTP:", $System.Status.GetErrorText(sc),! Set sc = sftp.Dir(".",.files) Write:$$$ISERR(sc) "Dir:", $System.Status.GetErrorText(sc),! set i = $ORDER(files("")) while i '= "" { write $listget(files(i),1),! set i = $ORDER(files(i)) } quit $$$OK }
enviroment
IRIS_Community-2021.2.0.651.0-lnxubuntu2004x64
Thank you for help.
Product version: IRIS 2021.2
I think you got the methods reversed. To connect using the key pair you should use this method:
I have tested this and it works
Sorry ,The code has been modified.
Is the private key file "id_rsa" or "p_id_rsa"?
Are the key files in "/path/to/" directory?
Thanks for the reply.
Sorry for the misunderstanding.
The sample program has been modified.
The same error occurs in the modified sample program.
What do you see in
?
The following logs were output.
Hopefully you've figured this out by now but I'd suggest looking at the Filezilla logs to see if anythings stands out compared to the ssh log you get from IRIS.
My best guess is that the FTP server may not support specifically "key-pair" authentication or might require multiple forms of authentication and the other sftp methods you tried (Filezilla, sftp) may be succeeding with other auth methods. This is somewhat documented here:
https://docs.intersystems.com/iris20221/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=%25Net.SSH.Session#AuthenticateWithKeyPair
You could reach out to the WRC with this.
Thank you very much.
I will check the normal logs against the abnormal logs.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue