-
-
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 #142 from blacknon/develop
Version 0.6.12
- Loading branch information
Showing
195 changed files
with
14,566 additions
and
779 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 |
---|---|---|
|
@@ -25,35 +25,22 @@ Supported multiple ssh proxy, http/socks5 proxy, x11 forward, and port forwardin | |
* Supported multiple proxy, **ssh**, **http**, and **socks5** proxy. It's supported multi-stage proxy. | ||
* Supported **ssh-agent**. | ||
* Supported **Local** and **Remote Port forward**, **Dynamic Forward(SOCKS5, http)**, **Reverse Dynamic Forward(SOCKS5, http)** and **x11 forward**. | ||
* By using **NFS Forward**/**NFS Reverse Forward**, the NFS server starts listening to the PATH of the local host or remote machine, making it available via local port forwarding. | ||
* Can use bashrc of local machine at ssh connection destination. | ||
* It supports various authentication methods. Password, Public key, Certificate and PKCS11(Yubikey etc.). | ||
* Can read the OpenSSH config (~/.ssh/config) and use it as it is. | ||
|
||
## Demo | ||
|
||
### run MacOSX | ||
|
||
<p align="center"> | ||
<img src="./images/lssh_macosx.gif" /> | ||
</p> | ||
|
||
### run Linux(Manjaro) | ||
|
||
<p align="center"> | ||
<img src="./images/lssh_linux.gif" /> | ||
</p> | ||
|
||
### run Windows(Windows 10) | ||
|
||
<p align="center"> | ||
<img src="./images/lssh_windows.gif" /> | ||
</p> | ||
|
||
## Install | ||
|
||
### compile | ||
|
||
compile gofile(tested go1.17.6). | ||
compile gofile(tested go1.22.5). | ||
|
||
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lssh | ||
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lscp | ||
|
@@ -104,11 +91,14 @@ option(lssh) | |
|
||
OPTIONS: | ||
--host servername, -H servername connect servername. | ||
--file filepath, -F filepath config filepath. (default: "/Users/uesugi/.lssh.conf") | ||
--file filepath, -F filepath config filepath. (default: "/Users/blacknon/.lssh.conf") | ||
-L [bind_address:]port:remote_address:port Local port forward mode.Specify a [bind_address:]port:remote_address:port. Only single connection works. | ||
-R [bind_address:]port:remote_address:port Remote port forward mode.Specify a [bind_address:]port:remote_address:port. If only one port is specified, it will operate as Reverse Dynamic Forward. Only single connection works. | ||
-D port Dynamic port forward mode(Socks5). Specify a port. Only single connection works. | ||
-d port HTTP Dynamic port forward mode. Specify a port. Only single connection works. | ||
-r port HTTP Reverse Dynamic port forward mode. Specify a port. Only single connection works. | ||
-M port:/path/to/remote NFS Dynamic forward mode. Specify a port:/path/to/remote. Only single connection works. | ||
-m port:/path/to/local NFS Reverse Dynamic forward mode. Specify a port:/path/to/local. Only single connection works. | ||
-w Displays the server header when in command execution mode. | ||
-W Not displays the server header when in command execution mode. | ||
--not-execute, -N not execute remote command and shell. | ||
|
@@ -118,7 +108,6 @@ option(lssh) | |
--parallel, -p run command parallel node(tail -F etc...). | ||
--localrc use local bashrc shell. | ||
--not-localrc not use local bashrc shell. | ||
--pshell, -s use parallel-shell(pshell) (alpha). | ||
--list, -l print server list from config. | ||
--help, -h print this help | ||
--version, -v print the version | ||
|
@@ -127,7 +116,7 @@ option(lssh) | |
blacknon([email protected]) | ||
|
||
VERSION: | ||
0.6.8 | ||
0.6.12 | ||
|
||
USAGE: | ||
# connect ssh | ||
|
@@ -139,6 +128,7 @@ option(lssh) | |
# run command parallel in selected server over ssh. | ||
lssh -p command... | ||
|
||
|
||
### lscpd | ||
|
||
run command. | ||
|
@@ -155,7 +145,7 @@ option(lscp) | |
OPTIONS: | ||
--host value, -H value connect servernames | ||
--list, -l print server list from config | ||
--file value, -F value config file path (default: "/Users/uesugi/.lssh.conf") | ||
--file value, -F value config file path (default: "/Users/blacknon/.lssh.conf") | ||
--permission, -p copy file permission | ||
--help, -h print this help | ||
--version, -v print the version | ||
|
@@ -164,7 +154,7 @@ option(lscp) | |
blacknon([email protected]) | ||
|
||
VERSION: | ||
0.6.8 | ||
0.6.12 | ||
|
||
USAGE: | ||
# local to remote scp | ||
|
@@ -191,22 +181,21 @@ option(lsftp) | |
lsftp [options] | ||
|
||
OPTIONS: | ||
--file value, -F value config file path (default: "/Users/uesugi/.lssh.conf") | ||
--file value, -F value config file path (default: "/Users/blacknon/.lssh.conf") | ||
--help, -h print this help | ||
--version, -v print the version | ||
|
||
COPYRIGHT: | ||
blacknon([email protected]) | ||
|
||
VERSION: | ||
0.6.8 | ||
0.6.12 | ||
|
||
USAGE: | ||
# start lsftp shell | ||
lsftp | ||
|
||
|
||
|
||
If you specify a command as an argument, you can select multiple hosts. Select host <kbd>Tab</kbd>, select all displayed hosts <kbd>Ctrl</kbd> + <kbd>a</kbd>. | ||
|
||
|
||
|
@@ -592,12 +581,17 @@ Besides this, you can also specify ProxyCommand like OpenSSH. | |
Supported Local/Remote/Dynamic port forwarding.\ | ||
You can specify from the command line or from the configuration file. | ||
|
||
When using NFS forward, lssh starts the NFS server and begins listening on the specified port. | ||
After that, the forwarded PATH can be used as a mount point on the local machine or the remote machine. | ||
|
||
#### command line option | ||
|
||
lssh -L 8080:localhost:80 # local port forwarding | ||
lssh -R 80:localhost:8080 # remote port forwarding | ||
lssh -D 10080 # dynamic port forwarding | ||
lssh -R 10080 # Reverse Dynamic port forwarding | ||
lssh -L 8080:localhost:80 # local port forwarding | ||
lssh -R 80:localhost:8080 # remote port forwarding | ||
lssh -D 10080 # dynamic port forwarding | ||
lssh -R 10080 # Reverse Dynamic port forwarding | ||
lssh -M port:/path/to/remote # NFS Dynamic forward. | ||
lssh -m port:/path/to/local # NFS Reverse Dynamic forward. | ||
|
||
#### config file | ||
|
||
|
@@ -632,17 +626,16 @@ You can specify from the command line or from the configuration file. | |
reverse_dynamic_port_forward = "11080" | ||
note = "reverse dynamic forwawrd example" | ||
|
||
|
||
|
||
If OpenSsh config is loaded, it will be loaded as it is. | ||
|
||
|
||
</details> | ||
|
||
## Related projects | ||
|
||
- [go-sshlib](github.com/blacknon/go-sshlib) | ||
- [lsshell](github.com/blacknon/lsshell) | ||
- [go-sshlib](https://github.com/blacknon/go-sshlib) | ||
- [lsshell](https://github.com/blacknon/lsshell) | ||
- [lsmon](https://github.com/blacknon/lsmon) | ||
|
||
## Licence | ||
|
||
|
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 |
---|---|---|
|
@@ -58,7 +58,7 @@ USAGE: | |
app.Name = "lscp" | ||
app.Usage = "TUI list select and parallel scp client command." | ||
app.Copyright = "blacknon([email protected])" | ||
app.Version = "0.6.11" | ||
app.Version = "0.6.12" | ||
|
||
// options | ||
// TODO(blacknon): オプションの追加(0.7.0) | ||
|
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ USAGE: | |
app.Name = "lsftp" | ||
app.Usage = "TUI list select and parallel sftp client command." | ||
app.Copyright = "blacknon([email protected])" | ||
app.Version = "0.6.11" | ||
app.Version = "0.6.12" | ||
|
||
app.Flags = []cli.Flag{ | ||
cli.StringFlag{Name: "file,F", Value: defConf, Usage: "config file path"}, | ||
|
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 |
---|---|---|
|
@@ -59,11 +59,11 @@ USAGE: | |
app.Name = "lssh" | ||
app.Usage = "TUI list select and parallel ssh client command." | ||
app.Copyright = "blacknon([email protected])" | ||
app.Version = "0.6.11" | ||
app.Version = "0.6.12" | ||
|
||
// TODO(blacknon): オプションの追加 | ||
// -m ... NFSマウントで、リモートホストの特定ディレクトリをローカルにマウント可能にする (v0.7.0) | ||
// -M ... リバースNFSマウントで、リモートホストの特定ディレクトリをローカルにマウント可能にする (v0.7.0) | ||
// -T ... マウント・リバースマウントのTypeを指定できるようにする(v0.7.0) | ||
// ※ そもそもfuseをそのままfusemountでマウントできるのか?という謎もある | ||
// -f ... バックグラウンドでの接続(X11接続やport forwardingをバックグラウンドで実行する場合など)。 | ||
// 「ssh -f」と同じ。 (v0.7.0) | ||
// (https://github.com/sevlyar/go-daemon) | ||
|
@@ -72,6 +72,8 @@ USAGE: | |
// ... 自動接続モード(接続が切れてしまった場合、自動的に再接続を試みる)。再試行の回数指定(デフォルトは3回?)。 (v0.7.0) | ||
// --read_profile | ||
// ... デフォルトではlocalrc読み込みでのshellではsshサーバ上のprofileは読み込まないが、このオプションを指定することで読み込まれるようになる (v0.7.0) | ||
// -P | ||
// ... 3muxを用いたマルチプレクサでのParallel Shell/Command実行を有効にする(v0.7.0) | ||
|
||
// Set options | ||
app.Flags = []cli.Flag{ | ||
|
@@ -85,6 +87,8 @@ USAGE: | |
cli.StringFlag{Name: "D", Usage: "Dynamic port forward mode(Socks5). Specify a `port`. Only single connection works."}, | ||
cli.StringFlag{Name: "d", Usage: "HTTP Dynamic port forward mode. Specify a `port`. Only single connection works."}, | ||
cli.StringFlag{Name: "r", Usage: "HTTP Reverse Dynamic port forward mode. Specify a `port`. Only single connection works."}, | ||
cli.StringFlag{Name: "M", Usage: "NFS Dynamic forward mode. Specify a `port:/path/to/remote`. Only single connection works."}, | ||
cli.StringFlag{Name: "m", Usage: "NFS Reverse Dynamic forward mode. Specify a `port:/path/to/local`. Only single connection works."}, | ||
|
||
// Other bool | ||
cli.BoolFlag{Name: "w", Usage: "Displays the server header when in command execution mode."}, | ||
|
@@ -236,6 +240,34 @@ USAGE: | |
} | ||
} | ||
|
||
// Set NFS Forwarding | ||
nfsForwarding := c.String("n") | ||
if nfsForwarding != "" { | ||
port, path, err := common.ParseNFSForwardPortPath(nfsForwarding) | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error: %s\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
r.NFSDynamicForwardPort = port | ||
r.NFSDynamicForwardPath = path | ||
} | ||
|
||
// Set NFS Reverse Forwarding | ||
nfsReverseForwarding := c.String("m") | ||
if nfsReverseForwarding != "" { | ||
port, path, err := common.ParseNFSForwardPortPath(nfsReverseForwarding) | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "Error: %s\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
path = common.GetFullPath(path) | ||
|
||
r.NFSReverseDynamicForwardPort = port | ||
r.NFSReverseDynamicForwardPath = path | ||
} | ||
|
||
// if err | ||
if err != nil { | ||
fmt.Printf("Error: %s \n", err) | ||
|
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
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.