ssh + reverse sshfs + port forwarder, in Docker-like CLI (predecessor of Lima)
ssh + reverse sshfs + port forwarder, in Docker-like CLI (predecessor of Lima)
$ sshocker -p 8080:80 -v .:/mnt/sshfs [email protected]example.com/mnt/sshfs on example.comThis is akin to docker run -p 8080:80 -v $(pwd):/mnt IMAGE, but sshocker is for remote hosts, not for containers.
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 sshockerTo compile from source:
make
sudo make installTested 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 sshfsGlobal flags:
--debug=(true|false) (default: false): debug moderun (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 portSSH flags:
-F, --ssh-config=FILE: specify SSH config file used for ssh -F--ssh-persist=(true|false) (default: true): enable ControlPersistSSHFS flags:
--sshfs-noempty (default: false): enable sshfs nonemptySFTP 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.helpShows help
No open issues yet, or sync has not completed.