Skip to content

Commit 09a075f

Browse files
committed
Initial import
0 parents  commit 09a075f

File tree

11 files changed

+1836
-0
lines changed

11 files changed

+1836
-0
lines changed

.gitignore

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
### Project Specific ###
2+
/minssh
3+
/build
4+
*.log
5+
6+
# Created by https://www.gitignore.io/api/go,vim,tags,emacs,macos,windows
7+
8+
### Emacs ###
9+
# -*- mode: gitignore; -*-
10+
*~
11+
\#*\#
12+
/.emacs.desktop
13+
/.emacs.desktop.lock
14+
*.elc
15+
auto-save-list
16+
tramp
17+
.\#*
18+
19+
# Org-mode
20+
.org-id-locations
21+
*_archive
22+
23+
# flymake-mode
24+
*_flymake.*
25+
26+
# eshell files
27+
/eshell/history
28+
/eshell/lastdir
29+
30+
# elpa packages
31+
/elpa/
32+
33+
# reftex files
34+
*.rel
35+
36+
# AUCTeX auto folder
37+
/auto/
38+
39+
# cask packages
40+
.cask/
41+
dist/
42+
43+
# Flycheck
44+
flycheck_*.el
45+
46+
# server auth directory
47+
/server/
48+
49+
# projectiles files
50+
.projectile
51+
52+
# directory configuration
53+
.dir-locals.el
54+
55+
### Go ###
56+
# Binaries for programs and plugins
57+
*.exe
58+
*.dll
59+
*.so
60+
*.dylib
61+
62+
# Test binary, build with `go test -c`
63+
*.test
64+
65+
# Output of the go coverage tool, specifically when used with LiteIDE
66+
*.out
67+
68+
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
69+
.glide/
70+
71+
### macOS ###
72+
*.DS_Store
73+
.AppleDouble
74+
.LSOverride
75+
76+
# Icon must end with two \r
77+
Icon
78+
79+
# Thumbnails
80+
._*
81+
82+
# Files that might appear in the root of a volume
83+
.DocumentRevisions-V100
84+
.fseventsd
85+
.Spotlight-V100
86+
.TemporaryItems
87+
.Trashes
88+
.VolumeIcon.icns
89+
.com.apple.timemachine.donotpresent
90+
91+
# Directories potentially created on remote AFP share
92+
.AppleDB
93+
.AppleDesktop
94+
Network Trash Folder
95+
Temporary Items
96+
.apdisk
97+
98+
### Tags ###
99+
# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
100+
TAGS
101+
.TAGS
102+
!TAGS/
103+
tags
104+
.tags
105+
!tags/
106+
gtags.files
107+
GTAGS
108+
GRTAGS
109+
GPATH
110+
GSYMS
111+
cscope.files
112+
cscope.out
113+
cscope.in.out
114+
cscope.po.out
115+
116+
117+
### Vim ###
118+
# swap
119+
[._]*.s[a-v][a-z]
120+
[._]*.sw[a-p]
121+
[._]s[a-v][a-z]
122+
[._]sw[a-p]
123+
# session
124+
Session.vim
125+
# temporary
126+
.netrwhist
127+
# auto-generated tag files
128+
129+
### Windows ###
130+
# Windows thumbnail cache files
131+
Thumbs.db
132+
ehthumbs.db
133+
ehthumbs_vista.db
134+
135+
# Folder config file
136+
Desktop.ini
137+
138+
# Recycle Bin used on file shares
139+
$RECYCLE.BIN/
140+
141+
# Windows Installer files
142+
*.cab
143+
*.msi
144+
*.msm
145+
*.msp
146+
147+
# Windows shortcuts
148+
*.lnk
149+
150+
# End of https://www.gitignore.io/api/go,vim,tags,emacs,macos,windows

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Tatsushi Demachi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
TARGET := minssh
2+
VERSION := v0.1.0
3+
GOX_OS := linux darwin windows
4+
GOX_ARCH := 386 amd64
5+
DATE := $(shell date +%FT%T%z)
6+
RM := rm -f
7+
RM_R := rm -rf
8+
ifeq ($(OS),Windows_NT)
9+
TARGET := $(TARGET).exe
10+
endif
11+
12+
SHA256 := $(shell sha256sum --help)
13+
ifdef SHA256 # usual linux
14+
SHA256 := sha256sum
15+
else # macOS
16+
SHA256 := shasum
17+
endif
18+
19+
PKG_NAME := minssh
20+
PLATFORMS := $(foreach arch,$(GOX_ARCH),$(addsuffix _$(arch),$(GOX_OS)))
21+
PLATFORMS_DIR := $(addprefix build/platforms/,$(PLATFORMS))
22+
RELEASE_PREFIX := build/release/$(VERSION)/$(PKG_NAME)_$(VERSION)_
23+
24+
OBJECTS := $(addprefix $(RELEASE_PREFIX),$(addsuffix .tar.gz,$(filter-out windows%,$(PLATFORMS))))
25+
OBJECTS += $(addprefix $(RELEASE_PREFIX),$(addsuffix .zip,$(filter windows%,$(PLATFORMS))))
26+
OBJECTS += $(RELEASE_PREFIX)checksums.txt
27+
28+
$(TARGET):
29+
go build -ldflags \
30+
"-X main.commitHash=$$(git rev-parse --short HEAD 2>/dev/null) \
31+
-X main.buildDate=$(DATE) \
32+
-w -s"
33+
34+
build/platforms:
35+
mkdir -p build/platforms
36+
37+
$(PLATFORMS_DIR): build/platforms
38+
gox -os="$(GOX_OS)" -arch="$(GOX_ARCH)" \
39+
-output "build/platforms/{{.OS}}_{{.Arch}}/{{.Dir}}" \
40+
-ldflags "-X main.commitHash=$$(git rev-parse --short HEAD 2>/dev/null) \
41+
-X main.buildDate=$(DATE) \
42+
-w -s"
43+
44+
build/release/$(VERSION):
45+
mkdir -p build/release/$(VERSION)
46+
47+
$(RELEASE_PREFIX)%.tar.gz: $(PLATFORMS_DIR) build/release/$(VERSION)
48+
cd build/platforms/$(*F) && tar czf $(CURDIR)/$@ ./*
49+
50+
$(RELEASE_PREFIX)%.zip: $(PLATFORMS_DIR) build/release/$(VERSION)
51+
cd build/platforms/$(*F) && zip $(CURDIR)/$@ ./*
52+
53+
$(RELEASE_PREFIX)checksums.txt: build/release/$(VERSION)
54+
cd build/release/$(VERSION) && $(SHA256) *.tar.gz *.zip > $(@F)
55+
56+
.PHONY: release
57+
release: $(OBJECTS)
58+
59+
.PHONY: clean
60+
clean:
61+
$(RM) $(TARGET)
62+
$(RM_R) build

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
MinSSH
2+
======
3+
4+
MinSSH is a SSH client with minimum functions written in Go. It can run on
5+
Linux, macOS and __Windows__.
6+
7+
## Features
8+
9+
- Only support interactive shell mode
10+
- Work on Windows Command Prompt and PowerShell (Especially work well on
11+
Windows 10 AU or later)
12+
- Can read OpenSSH `known_hosts` file and verify host
13+
- Support public key, keyboard interactive and password authentication
14+
15+
## Install
16+
17+
Download your platform binary from
18+
[Release page](https://github.com/tatsushid/minssh/releases) and put it
19+
somewhere you like.
20+
21+
If you'd like to build it by yourself, please use `go get`:
22+
23+
```shellsession
24+
$ go get -u github.com/tatsushid/minssh
25+
```
26+
27+
## Usage
28+
29+
Run the command like
30+
31+
```shellsession
32+
$ minssh user@hostname
33+
```
34+
35+
You can see command options by
36+
37+
```shellsession
38+
$ minssh -help
39+
```
40+
41+
If you run this on MSYS2/Cygwin with Mintty, please wrap this by
42+
[winpty](https://github.com/rprichard/winpty) like
43+
44+
```shellsession
45+
$ winpty minssh user@hostname
46+
```
47+
48+
It saves its own data in
49+
50+
- `$HOME/.minssh/` (Linux, macOS)
51+
- `%APPDATA%\minssh\` (Windows)
52+
53+
## Contribution
54+
55+
1. Fork ([https://github.com/tatsushid/minssh/fork](https://github.com/tatsushid/minssh/fork))
56+
2. Create a feature branch
57+
3. Commit your changes
58+
4. Rebase your local changes against the master branch
59+
5. Run test suite with the `go test ./...` command and confirm that it passes
60+
6. Run `go fmt`
61+
7. Create new Pull Request
62+
63+
## License
64+
65+
MinSSH is under MIT license. See the [LICENSE](./LICENSE) file for details.

0 commit comments

Comments
 (0)