Skip to content

Commit

Permalink
Add server-side auth-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
131 committed Jul 2, 2019
1 parent 2283929 commit f17dc9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,8 @@ You can find more examples in the `examples` directory of this repository.

* **forwardOut**(< _string_ >boundAddr, < _integer_ >boundPort, < _string_ >remoteAddr, < _integer_ >remotePort, < _function_ >callback) - _boolean_ - Alert the client of an incoming TCP connection on `boundAddr` on port `boundPort` from `remoteAddr` on port `remotePort`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic.

* **openssh_authAgent**(< _function_ >callback) - _boolean_ - Alert the client of an incoming `ssh-agent` socket connection. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic.

* **openssh_forwardOutStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _boolean_ - Alert the client of an incoming UNIX domain socket connection on `socketPath`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic.

* **rekey**([< _function_ >callback]) - _boolean_ - Initiates a rekeying with the client. If `callback` is supplied, it is added as a one-time handler for the `rekey` event. Returns `false` if you should wait for the `continue` event before sending any more traffic.
Expand Down Expand Up @@ -949,7 +951,7 @@ You can find more examples in the `examples` directory of this repository.

* **name** - _string_ - The signal name (e.g. `SIGUSR1`).

* **auth-agent**(< _mixed_ >accept, < _mixed_ >reject) - The client has requested incoming ssh-agent requests be forwarded to them. `accept` and `reject` are functions if the client requested a response and return `false` if you should wait for the `continue` event before sending any more traffic.
* **auth-agent**(< _mixed_ >accept, < _mixed_ >reject) - The client has requested incoming ssh-agent requests be forwarded to them. `accept` and `reject` are functions if the client requested a response.

* **shell**(< _mixed_ >accept, < _mixed_ >reject) - The client has requested an interactive shell. `accept` and `reject` are functions if the client requested a response. `accept()` returns a _Channel_ for the interactive shell. `reject()` Returns `false` if you should wait for the `continue` event before sending any more traffic.

Expand Down
7 changes: 7 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,11 @@ Client.prototype.forwardOut = function(boundAddr, boundPort, remoteAddr,
return openChannel(this, 'forwarded-tcpip', opts, cb);
};

Client.prototype.openssh_authAgent = function(cb) {
var opts = {};
return openChannel(this, '[email protected]', opts, cb);
};

Client.prototype.openssh_forwardOutStreamLocal = function(socketPath, cb) {
var opts = {
socketPath: socketPath
Expand Down Expand Up @@ -1123,6 +1128,8 @@ function openChannel(self, type, opts, cb) {
ret = sshstream.forwardedTcpip(localChan, initWindow, maxPacket, opts);
else if (type === 'x11')
ret = sshstream.x11(localChan, initWindow, maxPacket, opts);
else if(type == "[email protected]")
ret = sshstream.openssh_authAgent(localChan, initWindow, maxPacket);
else if (type === '[email protected]') {
ret = sshstream.openssh_forwardedStreamLocal(localChan,
initWindow,
Expand Down

0 comments on commit f17dc9b

Please sign in to comment.