Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Sshutil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
smallstep
Sshutil
Commits
dfbd7054
Commit
dfbd7054
authored
4 years ago
by
David Cowden
Browse files
Options
Downloads
Patches
Plain Diff
readme: Add more info and brush up examples
parent
a978de10
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+28
-1
28 additions, 1 deletion
README.md
with
28 additions
and
1 deletion
README.md
+
28
−
1
View file @
dfbd7054
...
@@ -23,10 +23,29 @@ A small, but tedious, amount of work is required to implement a full connection-
...
@@ -23,10 +23,29 @@ A small, but tedious, amount of work is required to implement a full connection-
[
rfc4252
]:
https://tools.ietf.org/html/rfc4252
[
rfc4252
]:
https://tools.ietf.org/html/rfc4252
[
rfc4253
]:
https://tools.ietf.org/html/rfc4253
[
rfc4253
]:
https://tools.ietf.org/html/rfc4253
## Get
```
$ go get go.step.sm/sshutil
```
## Examples
## Examples
Example can be found in the
[
examples
][]
directory.
Run with:
```
$ go run go.step.sm/example/<name>
$ go run ./example/<name>
```
[
examples
]:
https://github.com/smallstep/sshutil/tree/master/example
### Hello SSH
### Hello SSH
[
`hello`
](
https://github.com/smallstep/sshutil/tree/master/example/hello/main.go
)
```
golang
```
golang
package
main
package
main
...
@@ -45,7 +64,7 @@ func main() {
...
@@ -45,7 +64,7 @@ func main() {
Output:
Output:
```
```
$
./main
$
go run ./example/hello
$ ssh localhost -p 2022
$ ssh localhost -p 2022
Hello SSH
Hello SSH
Server closed remote connection to localhost.
Server closed remote connection to localhost.
...
@@ -56,6 +75,8 @@ Server closed remote connection to localhost.
...
@@ -56,6 +75,8 @@ Server closed remote connection to localhost.
The default session handler is an echo server.
The default session handler is an echo server.
Easily configure a persistent host key.
Easily configure a persistent host key.
[
`hostkey`
](
https://github.com/smallstep/sshutil/tree/master/example/hostkey/main.go
)
```
golang
```
golang
package
main
package
main
...
@@ -84,6 +105,7 @@ func main() {
...
@@ -84,6 +105,7 @@ func main() {
Output:
Output:
```
```
$ go run ./example/hostkey
$ ssh localhost -p 2022
$ ssh localhost -p 2022
> echo
> echo
echo
echo
...
@@ -91,3 +113,8 @@ echo
...
@@ -91,3 +113,8 @@ echo
Client closed connection to localhost.
Client closed connection to localhost.
```
```
## Test
```
$ go test
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment