Skip to content

Supraboy981322/mountSSH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

mountSSH

A simple wrapper for sshfs written entirely in Bash.

Dependencies · Install · Usage · Examples

Dependencies

  • Bash
  • jq
  • sshfs
  • Tailscale (optional; but will return error if used)

Install

Note

I plan to write an install script for this in the future, but it's not a high priority right now.

  1. Make and move to your install directory (replace /your/install/path, and replace mkcd with the commands mkdir and cd if not installed)

    mkcd /your/install/path/mountSSH
  2. Download the script and config json

    curl -O https://raw.githubusercontent.com/Supraboy981322/mountSSH/main/src/mountSSH.bash

    then

    curl -O https://raw.githubusercontent.com/Supraboy981322/mountSSH/main/src/machines.json
  3. Make mountSSH.bash executable (may require su)

    chmod a+x mountSSH.bash
  4. In order to run the script from anywhere, there are two options:

    • Create system alias (may require su, replace /your/install/path)

      echo 'alias mountSSH="/your/install/path/mountSSH/mountSSH.bash"' >> /etc/bash.bashrc
    • OR, add mountSSH install directory to system path (may require su, replace /your/install/path)

      echo 'PATH="$PATH:/your/install/path/mountSSH/"' >> /etc/bash.bashrc
  5. OPTIONAL (recommended): rename mountSSH.bash to mountSSH

    mv mountSSH.bash mountSSH

Usage

  • Help

    mountSSH -h
    
  • Version

    mountSSH -v
  • User (replace [your user])

    mountSSH -u [your user]
  • Remote machine (replace remote machine)

    mountSSH -m [remote machine]
  • Remote directory (replace /remote/dir)

    mountSSH -r /remote/dir
  • Local mount directory (replace /local/dir)

    mountSSh -l /local/dir
  • IP address (replace 192.168.5.37 with your remote machine's IP address)

    mountSSH -i 192.168.5.37

Examples

  • To mount the remote directory "/foo/bar" on a machine named "baz" as the user "qux" to the local directory "quux" (in the directory your user is currently located):

    mountSSH -r /foo/bar -m baz -u qux -l quux
  • If your local user is "foo", to mount the remote directory "/home/foo" on a remote machine named "bar" as the user "foo" to a local directory "bar" (which is located in your current directory)

    mountSSH -m bar
  • Assuming your local user is "foo", to mount the remote directory "/home/foo" on the machine "bar" with the ip address "47.93.14.33"

    mountSSH -m bar -i 47.93.14.33

About

A wrapper for sshfs written in Bash.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages