Skip to content

Commit

Permalink
Corrected spelling mistakes, added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rajch committed Jul 19, 2022
1 parent 39dca39 commit cc8e3f9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# sshclient
Simple SSH client library

Simple SSH client library for the kutti project.

[![Go Report Card](https://goreportcard.com/badge/github.com/kuttiproject/sshclient)](https://goreportcard.com/report/github.com/kuttiproject/sshclient)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/kuttiproject/sshclient)](https://pkg.go.dev/github.com/kuttiproject/sshclient)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/kuttiproject/sshclient?include_prereleases)
5 changes: 5 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Package sshclient provides a simple SSH client that uses password
// authentication for now. It contains functions for starting an
// interactive shell, running commands remotely and copying files to
// and from remote hosts.
package sshclient
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.18

require (
github.com/containerd/console v1.0.3
github.com/kuttiproject/kuttilog v0.1.2
github.com/kuttiproject/kuttilog v0.2.0
github.com/povsister/scp v0.0.0-20210427074412-33febfd9f13e
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
)

require golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
github.com/kuttiproject/kuttilog v0.1.2 h1:VEqVWrR3M6RME6aoUuVwXNO3bRpHKNp0ISAP/vqncpg=
github.com/kuttiproject/kuttilog v0.1.2/go.mod h1:OO3dHpXm1/Pjlc57R4c0e/C+ZWkYlY3Fd9Ikn8xPXi4=
github.com/kuttiproject/kuttilog v0.2.0 h1:rhgqjEIX7HAGOeqyAse0Ey+thfDu/Tefvs4zV7VuPYw=
github.com/kuttiproject/kuttilog v0.2.0/go.mod h1:VWyFjqLHbs2QzqPIB2rM/7GIgoH5zD5oopbkVuiG3VI=
github.com/povsister/scp v0.0.0-20210427074412-33febfd9f13e h1:VtsDti2SgX7M7jy0QAyGgb162PeHLrOaNxmcYOtaGsY=
github.com/povsister/scp v0.0.0-20210427074412-33febfd9f13e/go.mod h1:i1Au86ZXK0ZalQNyBp2njCcyhSCR/QP/AMfILip+zNI=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
7 changes: 4 additions & 3 deletions sshclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (sc *SSHClient) RunWithResults(address string, command string) (string, err
return string(resultdata), nil
}

// RunInterativeShell connects to the specified address and runs an interactive
// RunInteractiveShell connects to the specified address and runs an interactive
// shell.
func (sc *SSHClient) RunInterativeShell(address string) {
func (sc *SSHClient) RunInteractiveShell(address string) {
// Handle OS signals
sig := make(chan os.Signal, 1)
signal.Notify(sig, syscall.SIGTERM, syscall.SIGINT)
Expand Down Expand Up @@ -134,6 +134,7 @@ func (sc *SSHClient) runclient(ctx context.Context, address string) error {
if e, ok := err.(*ssh.ExitError); ok {
switch e.ExitStatus() {
case 130:
// Session terminated with a SIGINT
return nil
}
}
Expand Down Expand Up @@ -161,7 +162,7 @@ func (sc *SSHClient) CopyFrom(address string, remotePath string, localPath strin
return copyFileFromRemote(sc.config, address, remotePath, localPath)
}

// NewWithPassword creates a new SSH client with password authentication, and no host key check
// NewWithPassword creates a new SSH client with password authentication, and no host key check.
func NewWithPassword(username string, password string) *SSHClient {
return &SSHClient{
config: &ssh.ClientConfig{
Expand Down

0 comments on commit cc8e3f9

Please sign in to comment.