Skip to content

Conversation

robertodauria
Copy link
Contributor

@robertodauria robertodauria commented Jun 6, 2019

This PR adds the bmctool forward to create an SSH tunnel to a BMC through a trusted host.


This change is Reviewable

For the local endpoint, the port is the remote endpoint port + 1.
Copy link

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool :D :lgtm:

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @evfirerob and @stephen-soltesz)


cmd/forward.go, line 21 at r1 (raw file):

	tunnelHost string

	defaultPorts = []string{"4443:443", "5900"}

From a usability perspective, I will personally always use "443:443" to prevent odd behavior from the drac web UI. But, for default settings this is probably right.


cmd/forward.go, line 130 at r1 (raw file):

		log.Infof("Forwarding %s -> %s -> %s", localEndpoint, serverEndpoint, remoteEndpoint)
		errs.Go(tunnel.Start)

This is awesome.


tunnel/tunnel_test.go, line 17 at r1 (raw file):

func TestSSHTunnel_Start(t *testing.T) {
	handlerFunc := func(s sshserver.Session) {
		io.WriteString(s, "test")

Can this be an "echo" service? I was a little confused that "configure" resulted in "test".


tunnel/tunnel_test.go, line 111 at r1 (raw file):

	_, err := sshIn.Write([]byte(cmd + "\r"))
	if err != nil {
		t.Errorf("Cannot write: %v", err)

Test execution doesn't stop on t.Errors - it would for t.Fatal -- can the test continue meaningfully after a failed Write?

@robertodauria robertodauria merged commit 71a3416 into master Jun 7, 2019
@robertodauria robertodauria deleted the pr-tunnel branch June 7, 2019 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants