Giter Club home page Giter Club logo

sshync's Introduction

sshync

Auto-sync files or directories over SSH using fs.watch().

Comes with a nifty tool sshpair that generates a public SSH key with

echo -e "y\n" | ssh-keygen -q -N "" -f ~/.ssh/sshync

and writes the result to ~/.ssh/authorized_keys on the remote host. This prevents the password prompt from showing up every time we sync.

Ignore paths by adding them, one per line, to a file named .sshyncignore in the provided source folder.

install

$ npm install sshync -g

usage

# generate a public SSH key (so we don't have to retype password)
# write to user@ip:~/.ssh/authorized_keys

$ sshpair <user@ip[:port]>

# initialize file auto-sync
$ sshync <user@ip[:port]> <source> <destination>
          source:       local source folder.
          destination:  remote destination folder.

example

$ git clone https://github.com/mateogianolio/sshync.git
$ cd sshync
$ sshpair [email protected]
generated ssh key to ~/.ssh/sshync.pub
[email protected]'s password:
[email protected]'s password:
~/.ssh/sshync.pub => ~/.ssh/authorized_keys

$ echo -e ".git\nnode_modules" > .sshyncignore
$ sshync [email protected] . /root/sshync
. => [email protected]:/root/sshync

ignore ./.sshyncignore
mkdir -p /root/sshync
[+] ./README.md => /root/sshync/README.md [399 bytes]
[+] ./package.json => /root/sshync/package.json [520 bytes]
[+] ./sshync.js => /root/sshync/sshync.js [3304 bytes]
[+] ./LICENSE.md => /root/sshync/LICENSE.md [1084 bytes]
# ... edit package.json ...
[/] ./package.json => /root/sshync/package.json [524 bytes]

sshync's People

Contributors

mateogianolio avatar iamthechad avatar rdancer avatar

Watchers

James Cloos avatar Balaji Rajan 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.