B4A Library [Libary] jkSSH2 - SSH2 communication in B4A

Stefano Bordini

Member
Licensed User
Longtime User
Hi, i use thi library, and she work correctly in my lan, whit ssh.authenticateWithPassword connet,execute command and SSH_CmdExecuted, but now i want use in vm on google cloud and i need use ssh.authenticateWithKey,the app connect and execute command correctly,but after execute command don't trigger SSH_CmdExecuted.any suggest?
 

select

Member
Licensed User
Longtime User
Hi, I'm using this library with this simple code:
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private xui As XUI
    Dim ssh As jkSSH2
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout")
    ssh.Initialize("SSH", "myserver", 22)
    ssh.authenticateWithPassword("user", "pass")
    
End Sub

Sub Button1_Click

    ssh.execCommand("sudo systemctl stop minidlna", 10)
    
    
End Sub

When I try in debug mode all works well.
In relase mode, when I click on "Buttun1" the app close immediately.

Could someone help me understand why?
 

ajk

Active Member
Licensed User
Longtime User
it works correctly in release mode - look on 1st page and apply workaround to mainthread exception.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…