This quickly allows mounting of SFTP drives using SSHFS. This script has been tested on OSX and Linux.
cd <project_directory>
npm install
You can add alias sqm="<project_directory>/index.js"
to your ~/.bash_profile
or ~/.bashrc
to allow running the command sqm
from anywhere. This may require running chmod +x index.js
.
Create a settings.json
file in the project root with all the connection information.
Example
{
"bookmarks": [
{
"name": "site-number-1",
"host": "127.0.0.1",
"port": 2222,
"user": "denevents-staging",
"pass": "pwwithescaped\"quotes",
"path": "wp-includes/css/"
}, {
"name": "site-number-2",
"host": "127.0.0.2",
"port": 22,
"user": "awesomeuser",
"key": "/home/users/me/.ssh/id_rsa",
"path": "/"
}
]
}
sqm
can be substituted for node index.js
if you didn't do the optional alias setup.
Command | Details |
---|---|
sqm list |
List available bookmarks |
sqm mount |
Mount specified bookmark |
sqm unmount |
Unmount specified bookmark |
The default mount point is ~/.sftp_mounts