diff --git a/cmd/upterm/command/host.go b/cmd/upterm/command/host.go index b5c8438b1..0560a9bdf 100644 --- a/cmd/upterm/command/host.go +++ b/cmd/upterm/command/host.go @@ -92,7 +92,7 @@ func validateShareRequiredFlags(c *cobra.Command, args []string) error { } else { u, err := url.Parse(flagServer) if err != nil { - result = multierror.Append(result, fmt.Errorf("error pasring server URL: %w", err)) + result = multierror.Append(result, fmt.Errorf("error parsing server URL: %w", err)) } if u != nil { diff --git a/host/host.go b/host/host.go index e91c389b4..8885db7ce 100644 --- a/host/host.go +++ b/host/host.go @@ -71,7 +71,7 @@ type hostKeyCallback struct { func (cb hostKeyCallback) checkHostKey(hostname string, remote net.Addr, key ssh.PublicKey) error { if err := cb.HostKeyCallback(hostname, remote, key); err != nil { kerr, ok := err.(*knownhosts.KeyError) - // Return err if it's neither key error or no authrorities hostname error + // Return err if it's neither key error or no authorities hostname error if !ok && !strings.HasPrefix(err.Error(), errNoAuthoritiesHostname) { return err } @@ -186,7 +186,7 @@ func (c *Host) Run(ctx context.Context) error { logger := c.Logger.WithField("server", u) - logger.Info("Etablishing reverse tunnel") + logger.Info("Establishing reverse tunnel") rt := internal.ReverseTunnel{ Host: u, Signers: c.Signers, diff --git a/host/signer.go b/host/signer.go index 3adee4490..cb0efcfa2 100644 --- a/host/signer.go +++ b/host/signer.go @@ -28,7 +28,7 @@ func (e *errDescryptingPrivateKey) Error() string { return fmt.Sprintf("error decrypting private key %s", e.file) } -// Signers return signers based on the folllowing conditions: +// Signers return signers based on the following conditions: // If SSH agent is running and has keys, it returns signers from SSH agent, otherwise return signers from private keys; // If neither works, it generates a signer on the fly. func Signers(privateKeys []string) ([]ssh.Signer, func(), error) { diff --git a/server/cert.go b/server/cert.go index b6c048c69..5c06c9741 100644 --- a/server/cert.go +++ b/server/cert.go @@ -96,7 +96,7 @@ func (g *UserCertSigner) SignCert(signer ssh.Signer) (ssh.Signer, error) { }, } - // TODO: use differnt key to sign + // TODO: use different key to sign if err := cert.SignCert(rand.Reader, signer); err != nil { return nil, fmt.Errorf("error signing host cert: %w", err) } diff --git a/server/server.go b/server/server.go index 476129f2e..e18b9b204 100644 --- a/server/server.go +++ b/server/server.go @@ -45,7 +45,7 @@ func Start(opt Opt) error { network := networks.Get(opt.Network) if network == nil { - return fmt.Errorf("unsupport network provider %q", opt.Network) + return fmt.Errorf("unsupported network provider %q", opt.Network) } opts := parseNetworkOpt(opt.NetworkOpts) @@ -267,7 +267,7 @@ func (s *Server) ServeWithContext(ctx context.Context, sshln net.Listener, wsln // If sshln is not nil, always dial to SSHProxy. // So Host/Client -> WSProxy -> SSHProxy -> sshd/Session // This makes sure that SSHProxy terminates all SSH requests - // which provides a consistent authentication machanism. + // which provides a consistent authentication mechanism. cd = sshProxyDialer{ sshProxyAddr: sshln.Addr().String(), Logger: s.Logger.WithField("com", "ws-sshproxy-dialer"), diff --git a/server/sshd.go b/server/sshd.go index 0d920bede..80977c88e 100644 --- a/server/sshd.go +++ b/server/sshd.go @@ -89,7 +89,7 @@ func (s *sshd) Serve(ln net.Listener) error { return true }, - ChannelHandlers: make(map[string]ssh.ChannelHandler), // disallow channl requests, e.g. shell + ChannelHandlers: make(map[string]ssh.ChannelHandler), // disallow channel requests, e.g. shell RequestHandlers: map[string]ssh.RequestHandler{ streamlocalForwardChannelType: sh.Handler, cancelStreamlocalForwardChannelType: sh.Handler, diff --git a/server/sshd_test.go b/server/sshd_test.go index ce0ac65a7..05761a725 100644 --- a/server/sshd_test.go +++ b/server/sshd_test.go @@ -80,6 +80,6 @@ func Test_sshd_DisallowSession(t *testing.T) { _, err = client.NewSession() if err == nil || !strings.Contains(err.Error(), "unsupported channel type") { - t.Fatalf("expect unsupported channle type error but got %v", err) + t.Fatalf("expect unsupported channele type error but got %v", err) } } diff --git a/server/sshproxy_test.go b/server/sshproxy_test.go index fee0b2137..c798ac90f 100644 --- a/server/sshproxy_test.go +++ b/server/sshproxy_test.go @@ -125,7 +125,7 @@ func Test_sshProxy_dialUpstream(t *testing.T) { } _, err = client.NewSession() if err == nil || !strings.Contains(err.Error(), "unsupported channel type") { - t.Fatalf("expect unsupported channle type error but got %v", err) + t.Fatalf("expect unsupported channele type error but got %v", err) } }) } diff --git a/ws/client.go b/ws/client.go index 015a73890..d9eb0ef89 100644 --- a/ws/client.go +++ b/ws/client.go @@ -14,7 +14,7 @@ import ( // NewSSHClient creates a ssh client via ws. // The url must include username as session id and password as encoded node address. -// isUptermClient indicates whehter the client is host client or client client. +// isUptermClient indicates whether the client is host client or client client. func NewSSHClient(u *url.URL, config *ssh.ClientConfig, isUptermClient bool) (*ssh.Client, error) { conn, err := NewWSConn(u, isUptermClient) if err != nil { @@ -30,7 +30,7 @@ func NewSSHClient(u *url.URL, config *ssh.ClientConfig, isUptermClient bool) (*s // NewWSConn creates a ws net.Conn. // The url must include username as session id and password as encoded node address. -// isUptermClient indicates whehter the client is host client or client client. +// isUptermClient indicates whether the client is host client or client client. func NewWSConn(u *url.URL, isUptermClient bool) (net.Conn, error) { u, _ = url.Parse(u.String()) // clone user := u.User