Need help with sshocker?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

AkihiroSuda
145 Stars 6 Forks Apache License 2.0 18 Commits 5 Opened issues

Description

ssh + reverse sshfs + port forwarder, in Docker-like CLI

Services available

!
?

Need anything else?

Contributors list

# 14,751
Go
Docker
gRPC
runc
13 commits
# 2,219
d3v5
autoit
R
atom-pl...
1 commit

sshocker: ssh + reverse sshfs + port forwarder, in Docker-like CLI

$ sshocker -p 8080:80 -v .:/mnt/sshfs [email protected]
  • Forward connections to the port 8080 on the client to the port 80 on
    example.com
  • Mount the current directory on the client as
    /mnt/sshfs
    on
    example.com

This is akin to

docker run -p 8080:80 -v $(pwd):/mnt IMAGE
, but
sshocker
is for remote hosts, not for containers.

Install

Download from https://github.com/AkihiroSuda/sshocker/releases .

To download using curl:

curl -o sshocker --fail -L https://github.com/AkihiroSuda/sshocker/releases/latest/download/sshocker-$(uname -s)-$(uname -m)
chmod +x sshocker

To compile from source:

console
go get github.com/AkihiroSuda/sshocker/cmd/sshocker

Tested on macOS client and Linux server. May not work on other environments, especially on Windows.

To use reverse sshfs,

sshfs
needs to be installed on the server (not on the client):
$ ssh [email protected] -- sudo apt-get install -y sshfs

Usage

Global flags: *

--debug=(true|false)
(default:
false
): debug mode

Subcommand:
run
(default)

sshocker's equivalent of

docker run
.

e.g.

console
$ sshocker run -p 8080:80 -v .:/mnt/sshfs [email protected]

run
can be omitted, e.g.
console
$ sshocker -p 8080:80 -v .:/mnt/sshfs [email protected]

Flags (similar to

docker run
flags): *
-v LOCALDIR:REMOTEDIR[:ro]
: Mount a reverse SSHFS *
-p [[LOCALIP:]LOCALPORT:]REMOTEPORT
: Expose a port

SSH flags: *

-F
,
--ssh-config=FILE
: specify SSH config file used for
ssh -F
*
--ssh-persist=(true|false)
(default:
true
): enable ControlPersist

Subcommand:
help

Shows help

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.