Coder Social home page Coder Social logo

sssh's Introduction

๐Ÿ” Super SSH (SSSH)

A wrapper for interactive ssh clients

Keeping all the original ssh's features, you can use additional functions:

  • ๐Ÿ“‚ Mount your local files to remote by the docker-like --volume option
  • ๐Ÿ“‹ Clipboard over SSH
    • Copy text from your remote shell into your local clipboard
    • Paste text from your local clipboard into your remote shell
  • โ†ฉ๏ธ "Run commands in your local shell" from your remote shell

No additional daemon or alternative command is needed! Just use sssh instead of ssh w/o X11Forwarding

Work w/ ssh-related tools like amaya382/anyrc, Russell91/sshrc, and autossh

๐Ÿ“Ž Prerequisites

Local

  • ssh (or commands which have the same I/F as ssh)
  • openssh-sftp-server (or other sftp servers compatible w/ sshfs)
  • xsel or xclip or pbcopy/pbpaste

Remote

  • sshfs
  • user_allow_other in /etc/fuse.conf

๐Ÿ”ฑ Features

๐Ÿ“‚ Mount your local files to remote

You can bring local files into remote by using a --volume option like the docker command's --volume option. It will be automatically mounted and unmounted by sshfs.

Usage

Add a --volume option,

sssh [<ssh_opts_if_need_be>] --volume <local_dir>:<remote_dir> <remote_host>

๐Ÿ“‹ Clipboard over SSH

You can copy text from a remote shell into a local clipboard.

Usage

Without extra care,

$ sssh [<ssh_opts_if_need_be>] <remote_host>
Remote copy

And then, in the remote shell,

$ echo -ne 'from remote to local\n๐Ÿ‘' | rcopy

Now

from remote to local
๐Ÿ‘

is in your local clipboard! Of course, you can copy text from any tools (e.g., tmux, vim) by using rcopy command in your settings.

Remote paste

Yank text in the local desktop,

from local to remote
๐Ÿ‘

By rpaste command in the remote shell,

$ rpaste
from local to remote
๐Ÿ‘

โ†ฉ๏ธ Transparent reverse command execution

You can run commands in your local shell from remote shell.

Usage

Without extra care,

$ sssh [<ssh_opts_if_need_be>] <remote_host>

And then, in the remote shell,

$ echo 'hostname' | reval
<your local hostname>

๐Ÿ”ง Options

  • --ssh_cmd / SSSH_SSH_CMD: string (ssh)
    • ssh command (run in local)
    • e.g., Work w/ autossh: SSSH_SSH_CMD='autossh -M 0' sssh user@host
  • --sftp_cmd / SSSH_SFTP_CMD: string (/usr/lib/openssh/sftp-server)
    • sftp command (run in local)
  • --sshfs_cmd / SSSH_SSHFS_CMD: string (sshfs)
    • sshfs command (run in remote)
  • --sshfs_ssh_cmd / SSSH_SSHFS_SSH_CMD: string (ssh)
    • -o ssh_command in sshfs (run in remote)
    • e.g., Work w/ autossh: SSSH_SSHFS_SSH_CMD='autossh -M 0' sssh user@host
  • --sshfs_use_remote_uid / SSSH_SSHFS_USE_REMOTE_UID: boolean (true)
    • Use remote uid for mounting
  • --sshfs_use_allow_other / SSSH_SSHFS_USE_ALLOW_OTHER: boolean (true)
    • Use allow_other for mounting
  • --sshfs_use_cache / SSSH_SSHFS_USE_CACHE: boolean (false)
    • Use cache in sshfs
  • --enable_eval_and_clipboard / SSSH_ENABLE_EVAL_AND_CLIPBOARD: boolean (true)
    • Enable reverse eval and remote clipboard
  • --remote_copy_cmd_name / SSSH_REMOTE_COPY_CMD_NAME: string (rcopy)
    • Name of command for copying in the remote shell
  • --remote_paste_cmd_name / SSSH_REMOTE_PASTE_CMD_NAME: string (rpaste)
    • Name of command for pasting in the remote shell
  • --reverse_eval_cmd_name / SSSH_REVERSE_EVAL_CMD_NAME: string (reval)
    • Name of command for evaluating commands in the local shell

sssh's People

Contributors

amaya382 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

asya-kawai

sssh's Issues

Cannot mount volume in the bg

$ ./sssh --enable_eval_and_clipboard false --volume foo:/tmp/foo bar &
[1] 16844
[Warn] sssh is running w/o reverse eval and remote clipboard support
[1]  + suspended (tty output)  ./sssh --enable_eval_and_clipboard false --volume foo:/tmp/foo bar
# ssh bar
$ ls /tmp/foo # empty, not mounted

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.