-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from blacknon/develop
Develop
- Loading branch information
Showing
15 changed files
with
347 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,15 @@ TUI list select ssh/scp client. | |
|
||
## Description | ||
|
||
command to read a prepared list in advance and connect ssh/scp the selected host. List file is set in yaml format.When selecting a host, you can filter by keywords. Can execute commands concurrently to multiple hosts. Supported multiple ssh proxy, and supported http/socks5 proxy. | ||
command to read a prepared list in advance and connect ssh/scp the selected host. List file is set in yaml format. When selecting a host, you can filter by keywords. Can execute commands concurrently to multiple hosts. Supported multiple ssh proxy, and supported http/socks5 proxy. | ||
|
||
## Features | ||
|
||
* List selection type ssh client. | ||
* Pure Go. | ||
* Commands can be executed by ssh connection in parallel. | ||
* Supported multiple proxy. | ||
* Can use bashrc of local machine at ssh connection destination. | ||
|
||
## Demo | ||
|
||
|
@@ -23,7 +31,7 @@ lscp is need the following command in remote server. | |
|
||
## Install | ||
|
||
compile gofile(tested go1.8.3). | ||
compile gofile(tested go1.11.5). | ||
|
||
go get github.com/blacknon/lssh | ||
cd $GOPATH/src/github.com/blacknon/lssh | ||
|
@@ -40,9 +48,10 @@ brew install(Mac OS X) | |
# generate .lssh.conf(use ~/.ssh/config.not support proxy) | ||
lssh --generate > ~/.lssh.conf | ||
|
||
## Usage | ||
## Config | ||
|
||
Please edit "~/.lssh.conf". The connection information at servers,can be divided into external files. log dir "\<Date\>" => date(YYYYMMDD) ,"\<Hostname\>" => Servername. | ||
Please edit "~/.lssh.conf". | ||
For details see [wiki](https://github.com/blacknon/lssh/wiki/Config). | ||
|
||
example: | ||
|
||
|
@@ -53,7 +62,7 @@ example: | |
dirpath = "/path/to/logdir" | ||
|
||
# server common settings | ||
[common] | ||
[common] | ||
port = "22" | ||
user = "test" | ||
|
||
|
@@ -132,69 +141,76 @@ example: | |
addr = "example.com" | ||
port = "54321" | ||
|
||
After run command. | ||
|
||
## Usage | ||
|
||
run command. | ||
|
||
lssh | ||
|
||
|
||
option(lssh) | ||
|
||
NAME: | ||
lssh - TUI list select and parallel ssh client command. | ||
lssh - TUI list select and parallel ssh client command. | ||
USAGE: | ||
lssh [options] [commands...] | ||
|
||
lssh [options] [commands...] | ||
OPTIONS: | ||
--host value, -H value connect servernames | ||
--list, -l print server list from config | ||
--file value, -f value config file path (default: "$HOME/.lssh.conf") | ||
--term, -t run specified command at terminal | ||
--parallel, -p run command parallel node(tail -F etc...) | ||
--generate (beta) generate .lssh.conf from .ssh/config.(not support ProxyCommand) | ||
--help, -h print this help | ||
--version, -v print the version | ||
|
||
--host value, -H value connect servernames | ||
--list, -l print server list from config | ||
--file value, -f value config file path (default: "/home/blacknon/.lssh.conf") | ||
--portforward-local value port forwarding local port(ex. 127.0.0.1:8080) | ||
--portforward-remote value port forwarding remote port(ex. 127.0.0.1:80) | ||
--term, -t run specified command at terminal | ||
--parallel, -p run command parallel node(tail -F etc...) | ||
--generate (beta) generate .lssh.conf from .ssh/config.(not support ProxyCommand) | ||
--help, -h print this help | ||
--version, -v print the version | ||
COPYRIGHT: | ||
blacknon([email protected]) | ||
|
||
blacknon([email protected]) | ||
VERSION: | ||
0.5.1 | ||
|
||
0.5.2 | ||
USAGE: | ||
# connect ssh | ||
lssh | ||
|
||
# parallel run command in select server over ssh | ||
lssh -p command... | ||
|
||
# connect ssh | ||
lssh | ||
# parallel run command in select server over ssh | ||
lssh -p command... | ||
|
||
option(lscp) | ||
|
||
option(lscp) | ||
|
||
NAME: | ||
lscp - TUI list select and parallel scp client command. | ||
USAGE: | ||
lscp [options] (local|remote):from_path... (local|remote):to_path | ||
|
||
OPTIONS: | ||
--host value, -H value connect servernames | ||
--list, -l print server list from config | ||
--file value, -f value config file path (default: "$HOME/.lssh.conf") | ||
--file value, -f value config file path (default: "/home/blacknon/.lssh.conf") | ||
--permission, -p copy file permission | ||
--help, -h print this help | ||
--version, -v print the version | ||
|
||
COPYRIGHT: | ||
blacknon([email protected]) | ||
|
||
VERSION: | ||
0.5.1 | ||
|
||
0.5.2 | ||
USAGE: | ||
# local to remote scp | ||
lscp /path/to/local... /path/to/remote | ||
|
||
# remote to local scp | ||
lscp remote:/path/to/remote... /path/to/local | ||
|
||
If you specify a command as an argument, you can select multiple hosts. Select host 'Tab', select all displayed hosts 'Ctrl + A'. | ||
|
||
|
@@ -226,6 +242,10 @@ You can scp like copy files using stdin/stdout.It also supports multiple nodes(p | |
|
||
sample lssh.conf | ||
|
||
<p align="center"> | ||
<img src="./example/lssh_iterm2.gif" /> | ||
</p> | ||
|
||
[server.iTerm2_sample] | ||
addr = "192.168.100.103" | ||
key = "/path/to/private_key" | ||
|
@@ -234,6 +254,14 @@ sample lssh.conf | |
post_cmd = 'printf "\033]50;SetProfile=Default\a"' # local theme | ||
post_cmd = "(option) exec command after ssh disconnected." | ||
|
||
[server.GnomeTerminal_sample] | ||
addr = "192.168.100.103" | ||
key = "/path/to/private_key" | ||
note = "Before/After run local command" | ||
pre_cmd = 'printf "\033]50;SetProfile=dq\a"' # ssh theme | ||
post_cmd = 'printf "\033]50;SetProfile=Default\a"' # local theme | ||
post_cmd = "(option) exec command after ssh disconnected." | ||
|
||
|
||
### [lssh] use local bashrc file. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ USAGE: | |
app.Name = "lscp" | ||
app.Usage = "TUI list select and parallel scp client command." | ||
app.Copyright = "blacknon([email protected])" | ||
app.Version = "0.5.1" | ||
app.Version = "0.5.2" | ||
|
||
app.Flags = []cli.Flag{ | ||
cli.StringSliceFlag{Name: "host,H", Usage: "connect servernames"}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,8 @@ VERSION: | |
{{.Version}} | ||
{{end}} | ||
USAGE: | ||
# connect ssh | ||
{{.Name}} | ||
# connect ssh | ||
{{.Name}} | ||
# parallel run command in select server over ssh | ||
{{.Name}} -p command... | ||
|
@@ -51,13 +51,15 @@ USAGE: | |
app.Name = "lssh" | ||
app.Usage = "TUI list select and parallel ssh client command." | ||
app.Copyright = "blacknon([email protected])" | ||
app.Version = "0.5.1" | ||
app.Version = "0.5.2" | ||
|
||
// Set options | ||
app.Flags = []cli.Flag{ | ||
cli.StringSliceFlag{Name: "host,H", Usage: "connect servernames"}, | ||
cli.BoolFlag{Name: "list,l", Usage: "print server list from config"}, | ||
cli.StringFlag{Name: "file,f", Value: defConf, Usage: "config file path"}, | ||
cli.StringFlag{Name: "portforward-local", Usage: "port forwarding local port(ex. 127.0.0.1:8080)"}, | ||
cli.StringFlag{Name: "portforward-remote", Usage: "port forwarding remote port(ex. 127.0.0.1:80)"}, | ||
cli.BoolFlag{Name: "term,t", Usage: "run specified command at terminal"}, | ||
cli.BoolFlag{Name: "parallel,p", Usage: "run command parallel node(tail -F etc...)"}, | ||
cli.BoolFlag{Name: "generate", Usage: "(beta) generate .lssh.conf from .ssh/config.(not support ProxyCommand)"}, | ||
|
@@ -136,6 +138,9 @@ USAGE: | |
r.IsParallel = c.Bool("parallel") | ||
r.ExecCmd = c.Args() | ||
|
||
r.PortForwardLocal = c.String("portforward-local") | ||
r.PortForwardRemote = c.String("portforward-remote") | ||
|
||
r.Start() | ||
return nil | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[log] | ||
enable = true | ||
timestamp = true | ||
dirpath = "/path/to/logdir" | ||
|
||
[server.PasswordAuth_ServerName] | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.