https://github.com/creationix/sftp-server
sftp-server implemented in pure JS using node
https://github.com/creationix/sftp-server
Last synced: about 1 year ago
JSON representation
sftp-server implemented in pure JS using node
- Host: GitHub
- URL: https://github.com/creationix/sftp-server
- Owner: creationix
- Created: 2011-03-15T09:40:09.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-03-17T00:20:03.000Z (over 15 years ago)
- Last Synced: 2025-03-24T04:14:03.339Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02
- Size: 115 KB
- Stars: 28
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# NodeJS sftp-server
Have you ever mounted a remote system over ssh and wondered what protocol it used to transfer the files.
More than likely it was the sftp protocol (not to be confused with ftp or ftps or ftp over ssh).
In order to be able to mount embedded devices that don't have openssh or ftpd, I'm implementing just the sftp server protocol in JavaScript.
To test this, run the sftp.js file on one terminal:
node sftp.js
Then in another terminal, try to mount it using `sshfs`.
sudo mkdir /media/nodejs
sudo chown tim:tim /media/nodejs
sshfs -o directport=6000 localhost:/home/tim /media/nodejs
Then from there explore your new nodeJS powered filesystem. If you hit a part of the protocol I haven't fully implemented, your sshfs client will lock hard.
To recover from a lock, kill sshfs and umount
killall -9 sshfs
sudo umount /media/nodejs -l
The `killall` will free up your processes that got blocked by sshfs.