Giter Site home page Giter Site logo

sshocker's Introduction

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/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 [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.

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

run can be omitted, e.g.

$ 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

SSHFS flags:

  • --sshfs-noempty (default: false): enable sshfs nonempty

SFTP server flags:

  • --driver=DRIVER (default: auto): SFTP server driver. builtin (legacy) or openssh-sftp-server (robust and secure, recommended). openssh-sftp-server is chosen by default when the OpenSSH SFTP Server binary is detected.
  • --openssh-sftp-server=BINARY: OpenSSH SFTP Server binary. Automatically detected when installed in well-known locations such as /usr/libexec/sftp-server.

Subcommand: help

Shows help

sshocker's People

Contributors

akihirosuda avatar dependabot[bot] avatar afbjorklund avatar 0xflotus avatar yorinasub17 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.