Skip to content

afbjorklund/sshocker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

$ sshocker -p 8080:80 -v .:/mnt/sshfs user@example.com
  • 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/lima-vm/sshocker/releases .

To download using curl:

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

To compile from source:

make
sudo make install

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 user@example.com -- 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.

$ sshocker run -p 8080:80 -v .:/mnt/sshfs user@example.com

run can be omitted, e.g.

$ sshocker -p 8080:80 -v .:/mnt/sshfs user@example.com

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

About

ssh + reverse sshfs + port forwarder, in Docker-like CLI (predecessor of Lima)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.7%
  • Makefile 5.3%