{"id":16834694,"url":"https://github.com/mscdex/ssh-repl","last_synced_at":"2025-03-23T15:31:33.375Z","repository":{"id":54247362,"uuid":"64811392","full_name":"mscdex/ssh-repl","owner":"mscdex","description":"SSH into your node.js process and access a REPL","archived":false,"fork":false,"pushed_at":"2017-04-14T18:10:39.000Z","size":16,"stargazers_count":26,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T21:52:30.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mscdex.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}},"created_at":"2016-08-03T03:16:59.000Z","updated_at":"2024-04-07T20:46:38.000Z","dependencies_parsed_at":"2022-08-13T10:00:25.192Z","dependency_job_id":null,"html_url":"https://github.com/mscdex/ssh-repl","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fssh-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fssh-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fssh-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fssh-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscdex","download_url":"https://codeload.github.com/mscdex/ssh-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122835,"owners_count":20564387,"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":[],"created_at":"2024-10-13T12:07:24.889Z","updated_at":"2025-03-23T15:31:32.921Z","avatar_url":"https://github.com/mscdex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Description\n===========\n\nSSH into your [node.js](http://nodejs.org/) process and access a REPL.\n\nRequirements\n============\n\n* [node.js](http://nodejs.org/) -- v4.0.0 or newer\n\n\nInstall\n=======\n\n    npm install ssh-repl\n\n\nExample\n=======\n\n```javascript\nconst fs = require('fs');\n\nconst sshrepl = require('ssh-repl');\n\nconst repl = sshrepl({\n  server: {\n    hostKeys: [ fs.readFileSync('host.key') ]\n  },\n  users: {\n    foo: {\n      publicKey: fs.readFileSync('foo-key.pub'),\n      repl: { prompt: 'foo\u003e ' }\n    },\n    bar: {\n      password: 'baz',\n      repl: { prompt: 'bar\u003e ' }\n    }\n  },\n  port: 2244\n}, function(err, boundPort) {\n  if (err) throw err;\n  console.log('SSH REPL listening');\n});\n\n// Call `repl.close()` to stop listening\n```\n\nAPI\n===\n\n`require('ssh-repl')` returns a function that creates and starts an SSH REPL. It has the signature:\n\n* (\u003c _object_ \u003econfig[, \u003c _function_ \u003ecallback]) - _object_ - Creates and starts an SSH REPL. The object returned contains a `.close()` method to stop the server. It accepts an optional callback that is called when the server is closed. `config` can contain:\n\n    * **server** - _object_ - The configuration for the SSH server. See the [`ssh2`](https://github.com/mscdex/ssh2#server-methods) documentation for a list of supported properties.\n\n    * **port** - _integer_ - Port number to listen on.\n\n    * **users** - _mixed_ - The user configuration. This is used to both authenticate users and to optionally pass settings to [`repl.start()`](https://nodejs.org/docs/latest/api/repl.html#repl_repl_start_options). If `users` is a _function_, it is passed two arguments: (\u003c _string_ \u003eusername, \u003c _function_ \u003ecallback), where `callback` has the signature (\u003c _Error_ \u003eerr, \u003c _object_ \u003euserConfig). If `users` is an object, it should be keyed on username, with the value being the user configuration. Allowed user configuration properties:\n\n        * One of two authentication methods is required:\n\n            * **password** - _string_ - The password for the user.\n\n            * **publicKey** - _mixed_ - The public key for the user. This value can be a _Buffer_ instance or a _string_.\n\n        * **repl** - _object_ - If supplied, the properties on this object are passed on to [`repl.start()`](https://nodejs.org/docs/latest/api/repl.html#repl_repl_start_options).\n\n    If `callback` is supplied, it is called once the SSH REPL is listening for incoming connections. It has the signature (\u003c _Error_ \u003eerr, \u003c _number_ \u003eboundPort). The `boundPort` argument is useful when binding on port 0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fssh-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscdex%2Fssh-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fssh-repl/lists"}