{"id":24504336,"url":"https://github.com/vegardit/haxe-sshclient","last_synced_at":"2026-04-01T17:21:38.977Z","repository":{"id":70927514,"uuid":"585943806","full_name":"vegardit/haxe-sshclient","owner":"vegardit","description":"A haxelib that provides a basic SSH client which uses a pre-installed OpenSSH, Putty, or Kitty client under the hood.","archived":false,"fork":false,"pushed_at":"2025-11-25T11:17:38.000Z","size":63,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-01T21:52:18.726Z","etag":null,"topics":["hashlink","haxe","haxelib","kitty","neko","openssh","putty","ssh-client"],"latest_commit_sha":null,"homepage":"","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vegardit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-06T14:11:14.000Z","updated_at":"2025-11-25T11:17:21.000Z","dependencies_parsed_at":"2024-01-22T22:05:45.711Z","dependency_job_id":"6b45ad57-e934-4559-bb77-f4f0bab58297","html_url":"https://github.com/vegardit/haxe-sshclient","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vegardit/haxe-sshclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegardit%2Fhaxe-sshclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegardit%2Fhaxe-sshclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegardit%2Fhaxe-sshclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegardit%2Fhaxe-sshclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vegardit","download_url":"https://codeload.github.com/vegardit/haxe-sshclient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegardit%2Fhaxe-sshclient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31018555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hashlink","haxe","haxelib","kitty","neko","openssh","putty","ssh-client"],"created_at":"2025-01-21T23:23:09.490Z","updated_at":"2026-03-27T04:10:06.016Z","avatar_url":"https://github.com/vegardit.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"# haxe-sshclient\n\n[![Build Status](https://github.com/vegardit/haxe-sshclient/workflows/Build/badge.svg \"GitHub Actions\")](https://github.com/vegardit/haxe-sshclient/actions?query=workflow%3A%22Build%22)\n[![Release](https://img.shields.io/github/release/vegardit/haxe-sshclient.svg)](http://lib.haxe.org/p/haxe-sshclient)\n[![License](https://img.shields.io/github/license/vegardit/haxe-sshclient.svg?label=license)](#license)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)\n\n1. [What is it?](#what-is-it)\n1. [Installation](#installation)\n1. [Using the SSH client](#usage)\n1. [Using the latest code](#latest)\n1. [License](#license)\n\n\n## \u003ca name=\"what-is-it\"\u003e\u003c/a\u003eWhat is it?\n\nA [haxelib](http://lib.haxe.org/documentation/using-haxelib/) that provides a basic SSH client to execute commands on remote system. It uses a pre-installed\n[OpenSSH](https://www.openssh.com/), [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/), or [Kitty](https://www.9bis.net/kitty/index.html) client under the hood.\n\nAll classes are located in the package `hx.sshclient` or below.\n\n### Requirements/Limitations\n\n- **Haxe Version:** 4.2.0 or higher\n- **Supported Targets:** C++, C#, Neko, HashLink, Java/JVM, Python\n- **Supported Operating Systems:** Linux, MacOS, Windows\n- **Preinstalled software:** one of the following SSH clients must be installed:\n  - Linux/MacOS: OpenSSH (ssh), [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/) (plink)\n  - Windows: OpenSSH (ssh.exe), [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/) (plink.exe), [Kitty](https://www.9bis.net/kitty/index.html) (klink.exe)\n- **Password-based authentication** is only supported when using Putty/Kitty.\n\n\n## \u003ca name=\"installation\"\u003e\u003c/a\u003eInstallation\n\n1. MacOS, Linux and Windows 10 or higher have OpenSSH client preinstalled. If you want to use password based authentication install Putty or Kitty client:\n   - MacOS: `brew install putty`\n   - Debian/Ubuntu Linux: `sudo apt-get install -y putty-tools`\n   - RedHat Linux: `sudo yum install putty`\n   - Windows:\n     - Putty client: download **plink.exe** from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html\n     - Kitty client: download **klink.exe** from https://www.9bis.net/kitty/index.html#!pages/download.md\n\n1. Install the library via haxelib using the command:\n    ```\n    haxelib install haxe-sshclient\n    ```\n\n1. Use the library in your Haxe project:\n\n   - for [OpenFL](http://www.openfl.org/)/[Lime](https://github.com/openfl/lime) projects add `\u003chaxelib name=\"haxe-sshclient\" /\u003e` to your [project.xml](http://www.openfl.org/documentation/projects/project-files/xml-format/)\n   - for free-style projects add `-lib haxe-sshclient`  to `your *.hxml` file or as command line option when running the [Haxe compiler](http://haxe.org/manual/compiler-usage.html)\n\n\n## \u003ca name=\"usage\"\u003e\u003c/a\u003eUsing the SSH client\n\n### Configuring a Putty/Kitty based SSH client\n\nThe following code creates an SSH client backed by Putty/Kitty with default settings that:\n- either uses Putty or Kitty depending on which client was found on the system path - or fails if neither is found\n- uses HostKeyChecking strategy `Strict`, i.e. only connects to hosts that are already known\n- connects to port 22\n```haxe\nimport hx.sshclient.PuttySSHClient;\n//...\nvar sshClient = PuttySSHClient.builder()\n   .withHostname(\"myhost\")\n   .withUsername(\"myuser\")\n   .withSecret(Password(\"mypassword\"))\n   .build();\n```\n\nThe SSH client can be further configured:\n```haxe\nimport hx.sshclient.PuttySSHClient;\n//...\nvar sshClient = PuttySSHClient.builder()\n   .withHostname(\"myhost\")\n   .withPort(2222) // use a different port\n   .withUsername(\"myuser\")\n   .withSecret(IdentityFile(\"C:\\\\Users\\\\myser\\\\mykey.ppk\")) // use a private key for autentication\n   .withHostKeyChecking(AcceptNew) // allow connection to new hosts but prevent connections to known hosts with mismatching host keys\n   .withExecutable(\"C:\\\\apps\\\\network\\\\putty\\\\plink.exe\") // specify the client binary to be used\n   .build();\n```\n\n### Configuring an OpenSSH based SSH client\nThe following code creates an SSH client backed by OpenSSH with default settings that:\n- either uses an OpenSSH client or fails if not found on the system path\n- uses HostKeyChecking strategy `Strict`, i.e. only connects to hosts that are already known\n- connects to port 22\n```haxe\nimport hx.sshclient.OpenSSHClient;\n//...\nvar sshClient = OpenSSHClient.builder()\n   .withHostname(\"myhost\")\n   .withUsername(\"myuser\")\n   .withSecret(IdentityFile(\"/home/myuser/ssh/id_rsa\")) // use a private key for authentication\n   .build();\n```\n\nThe SSH client can be further configured:\n```haxe\nimport hx.sshclient.OpenSSHClient;\n//...\nvar sshClient = PuttySSHClient.builder()\n   .withHostname(\"myhost\")\n   .withPort(2222) // use a different port\n   .withUsername(\"myuser\")\n   .withHostKeyChecking(AcceptNew) // allow connection to new hosts but prevent connections to known hosts with mismatching host keys\n   .withExecutable(\"/opt/openssh/bin/ssh\") // specify the client binary to be used\n   .build();\n```\n\n### Executing a remote command via SSH\n\nOnce you have created an ssh client object you can execute remote commands:\n```haxe\nvar cmd = sshClient.execute(\"whoami\");\ncmd.awaitSuccess(5000); // wait 5 seconds for a successful response, throws an exception otherwise\nvar output = cmd.stdout.readAll().trim(); // retrieve the output of the executed command\ntrace('result: ${output}');\n```\n\n\n## \u003ca name=\"latest\"\u003e\u003c/a\u003eUsing the latest code\n\n### Using `haxelib git`\n\n```batch\nhaxelib git haxe-sshclient https://github.com/vegardit/haxe-sshclient main D:\\haxe-projects\\haxe-sshclient\n```\n\n###  Using Git\n\n1. check-out the main branch\n    ```batch\n    git clone https://github.com/vegardit/haxe-sshclient --branch main --single-branch D:\\haxe-projects\\haxe-sshclient\n    ```\n\n2. register the development release with Haxe\n    ```batch\n    haxelib dev haxe-sshclient D:\\haxe-projects\\haxe-sshclient\n    ```\n\n\n## \u003ca name=\"license\"\u003e\u003c/a\u003eLicense\n\nAll files are released under the [Apache License 2.0](LICENSE.txt).\n\nIndividual files contain the following tag instead of the full license text:\n```\nSPDX-License-Identifier: Apache-2.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvegardit%2Fhaxe-sshclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvegardit%2Fhaxe-sshclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvegardit%2Fhaxe-sshclient/lists"}