0

How do I use NMSSH in Swift? When I execute the code below, I get these messages in my debug console:

2019-11-14 19:15:53.830479+0100 unLock[49480:480479] NMSSH: Start 192.168.178.97 resolution
2019-11-14 19:15:53.832950+0100 unLock[49480:480481] NMSSH: Socket connection to 192.168.178.97 on port 44 failed with reason -1, trying next address...
2019-11-14 19:15:53.833005+0100 unLock[49480:480481] NMSSH: Failure establishing socket connection
2019-11-14 19:15:53.833047+0100 unLock[49480:480481] NMSSH: Disconnected

The code:

let session = NMSSHSession(host: "192.168.178.97:44", andUsername: "root")
        session.connect()
        if session.isConnected == true{
            session.authenticate(byPassword: "alpine")
            //if session.isAuthorized == true {
                session.channel.execute("killall SpringBoard", error: nil)
                print("killed Springboard")
            //}
        }

What I've done is allowing arbitrary Loads in App Transport Security because I thought the problem may be that the ssh server isn't HTTPS, but it did not help. The fact that I try to SSH into an iPhone isn't the cause Haswell, as I tried it with a Raspberry Pi, same result. Also don't mind port 44 as it is the correct port for checkra1n.

DerMichi
  • 13
  • 3
  • You can see similar type problem here. [https://stackoverflow.com/questions/26110980/how-to-use-nmssh-in-swift](https://stackoverflow.com/questions/26110980/how-to-use-nmssh-in-swift) – Parth Nov 14 '19 at 19:07

1 Answers1

0

You can see similar type problem here.

How to use NMSSH in swift

Also Read the Readme file for NMSSH and setup this framework using podfile.

pod 'NMSSH'

Read Documentation here

https://github.com/NMSSH/NMSSH

Parth
  • 634
  • 8
  • 15