Commit Graph

104 Commits

Author SHA1 Message Date
Alan Yee
f5cb472d2a
Update README.md (#135) 2020-02-13 21:01:06 -06:00
Kaleb Elwert
59d6e4540d
Merge pull request #123 from gliderlabs/optimize-add-host-key
Update AddHostKey to avoid always appending
2019-10-23 09:01:01 -07:00
Kaleb Elwert
1db07d8a37 Make TestSignals a bit more bulletproof 2019-10-16 11:22:57 -07:00
Kaleb Elwert
be3a169b0c Fix TestSignals to remove a possible race 2019-10-16 10:42:43 -07:00
Kaleb Elwert
38820366bb Start cleaning up config to fix race conditions 2019-10-16 10:27:39 -07:00
Kaleb Elwert
f79e692124 Update AddHostKey to avoid always appending 2019-10-16 10:07:55 -07:00
Kaleb Elwert
63518b5243
Merge pull request #122 from Michael9127/pass-ConnCallback-context
Passes Context into ConnCallback
2019-10-09 09:06:44 -07:00
Michael Borkenstein
e9ac9d7af2 Passes Context into ConnCallback 2019-10-09 09:17:49 -05:00
Hiram Chirino
f6d256ee25 feat: Make the HandleConn method public. (#120) 2019-09-27 13:30:27 -07:00
xf0rk
866d0ddf79 Ensure user information is available in KeyboardInteractive callback
Fixes #116
2019-07-11 11:02:43 -07:00
Kaleb Elwert
5b6cc7030f
Merge pull request #110 from gliderlabs/belak/raw-cmd
Add Session.RawCommand()
2019-06-19 20:22:20 -07:00
Luis Gustavo S. Barreto
ac34fea39f Update remoteforward example to follow configurable handlers feature 2019-06-19 10:59:27 -07:00
Kaleb Elwert
93eb073412
Merge pull request #112 from gustavosbarreto/fix_build_error
Fix build error
2019-06-19 10:48:18 -07:00
Luis Gustavo S. Barreto
31eb4b717f Fix build error 2019-06-19 13:53:26 -03:00
Kaleb Elwert
0f1eb383c3 Rename DefaultServerConfigCallback to ServerConfigCallback 2019-06-19 02:06:29 -07:00
kuehnelth
446473b0d4 examples/ssh-pty: wait for child process after client disconnect (#104) 2019-06-19 02:03:30 -07:00
Luis Gustavo S. Barreto
86efb70628 Fix ForwardedTCPHandler by switching to a pointer receiver
Closes #109
2019-06-19 01:45:13 -07:00
Kaleb Elwert
bb0e5c0692 Simplify handlers to remove additional types 2019-06-19 01:24:53 -07:00
Kaleb Elwert
f199e8cd1e
Merge pull request #108 from gliderlabs/configurable-handlers
Configurable channel handlers

Closes #89, #71
2019-06-19 00:26:59 -07:00
Andrew Chambers
44274595c2 Add Session.RawCommand() 2019-06-19 00:20:00 -07:00
Kaleb Elwert
dd61f8b0d5 Disable port forwarding by default
Fixes #68
2019-06-12 10:52:26 -07:00
Kaleb Elwert
465d1bd2c7 Clean up Request replies 2019-06-12 10:42:05 -07:00
Kaleb Elwert
c9e327ebeb Remove Handler getters and setters 2019-06-12 10:41:07 -07:00
Kaleb Elwert
77856273e0 Clean up Channel and Request Handler interfaces 2019-06-12 10:29:36 -07:00
Kaleb Elwert
75b695471d Merge remote-tracking branch 'moul/dev/moul/configurable-handlers' into configurable-handlers 2019-06-12 10:14:10 -07:00
Kaleb Elwert
a9daacccc9 Fix panic with missing request handler
Fixes #102
2019-04-24 23:59:04 -07:00
czoczo
9253a53eda Fix connection kill, when IdleTimeout given without setting MaxTimeout. 2019-03-31 09:59:03 -07:00
Kaleb Elwert
ef6d89046b Remove Pty minimum size requirement 2019-03-08 11:26:50 -08:00
Kaleb Elwert
e5ece1489c Add SessionPolicyCallback (#80)
* Add SessionPolicyCallback

Closes #7

* Update docs related to the embedded sync.Locker in the Context

* Fix mutex in context
2019-02-22 20:11:43 -06:00
Philipp C. Heckel
4b72c663cf Add DefaultServerConfigCallback option for create custom default (#95)
ServerConfigs
2019-02-21 13:57:56 -06:00
Kaleb Elwert
bed87f398c
Merge pull request #92 from glassechidna/master
Added Server.KeyboardInteractiveHandler
2019-01-07 11:22:28 -08:00
Aidan Steele
c2883aad47
Import x/net/crypto/ssh with alias gossh 2019-01-07 08:09:35 +11:00
Aidan Steele
6dcd5356b5 Added Server.KeyboardInteractiveHandler 2019-01-06 15:25:33 +11:00
Jose Diaz-Gonzalez
570aa23f40
fix: use idiomatic go 2018-12-23 18:05:39 -05:00
Manfred Touron
8b3cdd49b6
feat: configurable server handlers 2018-11-16 14:56:57 +01:00
Jeff Lindsay
cbabf54144
Remote forwarding (#88)
* context: fixed documentation to be more specific about ContextKeyConn being the key for a gossh.ServerConn

Signed-off-by: Jeff Lindsay <progrium@gmail.com>

* server: fixes handler setup, changed to interface based handlers, added global request handler map

* tcpip: working remote forwarding

Signed-off-by: Jeff Lindsay <progrium@gmail.com>

* context: docs typo

Signed-off-by: Jeff Lindsay <progrium@gmail.com>

* session: always reply to unblock clients trying something

Signed-off-by: Jeff Lindsay <progrium@gmail.com>

* tcpip: stop listening when ssh clients disconnect

Signed-off-by: Jeff Lindsay <progrium@gmail.com>

* Remote forwarding (#87)

* Update generateSigner key size to 2048 (#62)

Fixes #58

* Add syntax highlighting to readme (#67)

* small api updates (#69)

These updates make it easier to implement and pass custom Session and
Context implementations

No compatibilty breaking, all tests pass

* Move channelHandlers to avoid data race (#59)

* Update tests to work with go 1.10+ (#73)

Fixes #72

* Update shutdown to use a WaitGroup rather than sleeping (#74)

* Fix race condition in TestServerClose (#75)

In test server close, 3 things need to happen in order:

- Client session start
- Server.Close
- Client session exit (With io.EOF)

This fix ensures the client won't do anything until after the call to
close which ensure's we'll get io.EOF rather than a different error.

* Update circleci config to test multiple go versions

* Update CircleCI config to test 1.9 and the latest

The x/crypto/ssh library dropped support go < 1.9 as that's the first
version to have the math/bits library.

83c378c48d

* Wait for connections to finish when shutting down

PR #74 introduced a WaitGroup for listeners, but it doesn't wait for
open connections before closing the server. This patch waits until all
conns are closed before returning from Shutdown.

*  Support port forwarding of literal IPv6 addresses (#85)

* Support port forwarding of literal IPv6 addresses

To disambiguate between colons as host:port separators and as IPv6 address separators, literal IPv6 addresses use square brackets around the address (https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers).  So host ::1, port 22 is written as [::1]:22, and therefore a simple concatenation of host, colon, and port doesn't work.  Fortunately net.JoinHostPort already implements this functionality, so with a bit of type gymnastics we can generate dest in an IPv6-safe way.

* Support port forwarding of literal IPv6 addresses

To disambiguate between colons as host:port separators and as IPv6 address separators, literal IPv6 addresses use square brackets around the address (https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers).  So host ::1, port 22 is written as [::1]:22, and therefore a simple concatenation of host, colon, and port doesn't work.  Fortunately net.JoinHostPort already implements this functionality, so with a bit of type gymnastics we can generate dest in an IPv6-safe way.

* Reverse port forwarding callback added

* garbage removed
2018-11-13 10:04:02 -06:00
Marc Fielding
c072a10770 Support port forwarding of literal IPv6 addresses (#85)
* Support port forwarding of literal IPv6 addresses

To disambiguate between colons as host:port separators and as IPv6 address separators, literal IPv6 addresses use square brackets around the address (https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers).  So host ::1, port 22 is written as [::1]:22, and therefore a simple concatenation of host, colon, and port doesn't work.  Fortunately net.JoinHostPort already implements this functionality, so with a bit of type gymnastics we can generate dest in an IPv6-safe way.

* Support port forwarding of literal IPv6 addresses

To disambiguate between colons as host:port separators and as IPv6 address separators, literal IPv6 addresses use square brackets around the address (https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers).  So host ::1, port 22 is written as [::1]:22, and therefore a simple concatenation of host, colon, and port doesn't work.  Fortunately net.JoinHostPort already implements this functionality, so with a bit of type gymnastics we can generate dest in an IPv6-safe way.
2018-09-23 19:41:38 -05:00
John Barnette
d3a6756290 Wait for connections to finish when shutting down
PR #74 introduced a WaitGroup for listeners, but it doesn't wait for
open connections before closing the server. This patch waits until all
conns are closed before returning from Shutdown.
2018-05-07 16:10:55 -07:00
Kaleb Elwert
2a96aa1cdd Update CircleCI config to test 1.9 and the latest
The x/crypto/ssh library dropped support go < 1.9 as that's the first
version to have the math/bits library.

83c378c48d
2018-05-07 16:08:31 -07:00
Kaleb Elwert
8c1707734e Update circleci config to test multiple go versions 2018-04-16 19:53:05 -07:00
Kaleb Elwert
8ba78c2f83 Fix race condition in TestServerClose (#75)
In test server close, 3 things need to happen in order:

- Client session start
- Server.Close
- Client session exit (With io.EOF)

This fix ensures the client won't do anything until after the call to
close which ensure's we'll get io.EOF rather than a different error.
2018-04-16 20:00:03 -05:00
Kaleb Elwert
ef66069ab6 Update shutdown to use a WaitGroup rather than sleeping (#74) 2018-04-16 19:30:27 -05:00
Kaleb Elwert
66f55c879c Update tests to work with go 1.10+ (#73)
Fixes #72
2018-04-16 19:16:34 -05:00
phil-halley
d6295a6cbc Move channelHandlers to avoid data race (#59) 2018-04-04 13:06:36 -05:00
Manfred Touron
47df570d18 small api updates (#69)
These updates make it easier to implement and pass custom Session and
Context implementations

No compatibilty breaking, all tests pass
2018-01-09 12:15:16 -06:00
Fredrik Forsmo
ce31f3cc47 Add syntax highlighting to readme (#67) 2017-12-06 14:46:25 -06:00
Kaleb Elwert
3d95f1a04b Update generateSigner key size to 2048 (#62)
Fixes #58
2017-11-12 18:38:17 -06:00
Kaleb Elwert
0c9c3575f4 Switch to using gossh.ParsePrivateKey when reading PrivateKeys (#61)
Refs #56
2017-11-01 18:11:58 -05:00
Jeff Lindsay
3eeacb7850
session: adding signal handling support (#44) 2017-11-01 18:03:54 -05:00
Steven Murr
4a4de396c4 Merge pull request #54 from stevemurr/master
Updated SSH docker example
2017-09-01 09:20:11 -07:00