apple / swift-nio-ssh

SwiftNIO SSH is a programmatic implementation of SSH using SwiftNIO
Apache License 2.0
388 stars 47 forks source link

Simple SSH Client port forwarding #108

Open vheydari opened 2 years ago

vheydari commented 2 years ago

I am trying to figure out how to write a simple Swift code for running an ssh client port forwarding command. I am aware of [swift-nio-ssh] but am not sure how to use that in Xcode. Any suggestion?

Lukasa commented 2 years ago

swift-nio-ssh can be used as a Swift Package in Xcode and imported as normal. Example code is present in the repository here, with this block (and its associated code) being an indication of how to drive port forwarding.

Note that swift-nio-ssh is very low level: it's not terribly easy to use and requires a lot of familiarity with both SSH and with NIO.

vheydari commented 2 years ago

Thank you, @Lukasa. Just for clarification, I am looking for an SSH Client code to do port forwarding on iOS. The SSH server is a Linux machine. Should I go with swift-nio-ssh or do you have another suggestion?

I really appreciate your help.

Lukasa commented 2 years ago

swift-nio-ssh is certainly capable of doing the job, but I don't know if anyone in the Swift community has a higher-level wrapper you can use.

Joannis commented 2 years ago

@vheydari did you check out Citadel?