: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