{"id":19829703,"url":"https://github.com/dyalog/aplssh","last_synced_at":"2026-03-02T22:32:45.074Z","repository":{"id":81318335,"uuid":"102481336","full_name":"Dyalog/aplssh","owner":"Dyalog","description":"libssh2 bindings for Dyalog APL","archived":false,"fork":false,"pushed_at":"2020-02-25T12:39:14.000Z","size":311,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-11T09:47:22.736Z","etag":null,"topics":["apl","dyalog","dyalog-apl","libssh2","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"APL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dyalog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2017-09-05T12:57:46.000Z","updated_at":"2024-05-01T14:25:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0b4cba9-3e45-426c-90b9-be355d74db03","html_url":"https://github.com/Dyalog/aplssh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyalog%2Faplssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyalog%2Faplssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyalog%2Faplssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyalog%2Faplssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dyalog","download_url":"https://codeload.github.com/Dyalog/aplssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241188956,"owners_count":19924717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["apl","dyalog","dyalog-apl","libssh2","wrapper"],"created_at":"2024-11-12T11:19:42.377Z","updated_at":"2026-03-02T22:32:45.032Z","avatar_url":"https://github.com/Dyalog.png","language":"APL","readme":"## APLSSH\n\nThis is a wrapper around the `libssh2` library. Currently, it only exposes a small fraction of its functionality.\nIt can execute remote commands, and read and write files.\n\nExample session:\n\n```apl\n\n      ⍝ connect to a host\n      sess←⎕NEW SSH.Session ('10.0.60.249' 22)\n      sess.HostkeyHash 'MD5'\n85 246 47 235 173 71 184 56 162 14 123 196 75 109 197 123\n\n      ⍝ authenticate\n      sess.Userauth_Publickey 'marinus' '/home/marinus/apl_sshid/id_rsa.pub' '/home/marinus/apl_sshid/id_rsa' ''\n      sess.Authenticated\n1\n\n      ⍝ run a command\n      x←sess.Exec 'ls *.txt'\n      ⍝ the first element contains the return code, the second element contains STDOUT (as bytes)\n      x\n┌─┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n│0│115 99 112 116 101 115 116 46 116 120 116 10 116 101 115 116 46 116 120 116 10 119 114 105 116 101 95 116 101 115 \n└─┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n      ─────────────────────┐\n      116 46 116 120 116 10│\n      ─────────────────────┘\n      ⎕UCS 2⊃x\nscptest.txt\ntest.txt\nwrite_test.txt\n\n      ⍝ read a file\n      test_txt←sess.ReadFile 'test.txt'\n      ⍝ the first element contains information about the file (size, mode, mtime, atime)\n      ⍝ the second element contains the file's contents (as bytes)\n      test_txt\n┌───────────────────────────┬──────────────┐\n│4 436 1503307650 1502811867│102 111 111 10│\n└───────────────────────────┴──────────────┘\n      ⎕UCS 2⊃test_txt\nfoo\n\n      ⍝ write a file\n      sess.WriteFile 'test2.txt' (⎕UCS 'This will be written.')\n      ⍝ let's see if it's there\n      ⎕UCS 2⊃sess.Exec'ls *.txt'\nscptest.txt\ntest2.txt\ntest.txt\nwrite_test.txt\n\n      ⎕UCS 2⊃sess.Exec'cat test2.txt'\nThis will be written.\n      \n      sess.Disconnect ⍬\n      \n```\n\nAlso included is a version of `APLProcess` that supports SSH connections using these classes.\n\nTo start an APL process on a remote machine:\n\n```apl\nx←⎕NEW APLProcess (ws args (host user pubkey privkey executable))\n```\n\nE.g.:\n\n```apl\nx←⎕NEW APLPRocess ('~/Test.dws' '' ('10.20.30.40' 'marinus' 'id_rsa.pub' 'id_rsa' 'dyalog'))\n```\n\n### Third-party licences\n\nBinary copies of [libssh2](https://www.libssh2.org/) included with aplssh are redistributed according to the following licence:\n\nCopyright (c) 2004-2007 Sara Golemon \u003csarag@libssh2.org\u003e  \nCopyright (c) 2005,2006 Mikhail Gusarov \u003cdottedmag@dottedmag.net\u003e  \nCopyright (c) 2006-2007 The Written Word, Inc.  \nCopyright (c) 2007 Eli Fant \u003celifantu@mail.ru\u003e  \nCopyright (c) 2009-2014 Daniel Stenberg  \nCopyright (C) 2008, 2009 Simon Josefsson  \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of any other contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyalog%2Faplssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyalog%2Faplssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyalog%2Faplssh/lists"}