SSH Login to remote Mac

Hi!

I am trying to establish a ssh connection to a remote Mac using a Xojo shell, but unfortunately I got stuck sending the password.
Where is my mistake:

[i]dim sh As new Shell

	sh.Mode = 2 
	
	dim SSH_Login As String
	SSH_Login = "ssh 192.168.0.15 -l sammlungen"
	
	sh.Execute(SSH_Login)
	If sh.ErrorCode = 0 Then
			  TextField1.Text = sh.ReadAll
	Else
			  MsgBox("Error code: " + Str(sh.ErrorCode))
	End If
	
	Dim waitUntil As Integer = Ticks + 20
	While ticks < waitUntil
	Wend
	
	sh.WriteLine("sammlungen")
	If sh.ErrorCode = 0 Then
			  TextField1.Text = sh.ReadAll
	Else
			  MsgBox("Error code: " + Str(sh.ErrorCode))
	End If[/i]

Any help is appreciated :slight_smile:

Thanks in advance,

Eric

Don’t know the answer but if it’s possible why not skip the password?
https://coolestguidesontheplanet.com/create-a-ssh-private-and-public-key-in-osx-10-11/

From the Xojo-Documentation of Shell.Mode = 2 :

Data can be sent to a running shell session with the Write method and data is returned via the DataAvailable event.

When using the DataAvailable-Event everything works for me

You could also try the SSH classes in MBS Network Plugin.
Doing SSH without shell.

I tried to get a full fledged ssh terminal connection calling terminal.app from a Xojo program with all needed parameters, but since I’m a MAC noob I did not get very far, particularly when trying to open multiple ssh connections.

Any hints how to accomplish this?