0

edit: it turned out that the hard drive of my dev box is broken.

original:

I do this every day, but it suddenly down today. I tried restart.

  1. I mount to my devbox

    sshfs -o cache=yes root@zh*****:/var/www www
    
  2. Then I

    ssh root@zh*****
    

    and go to www/app open sublime there and edit files

The problem is whenever I want to save file, Sublime says "Unable to save ~/www/app/**.js"

Also I can't open files on devbox through vim. And also I got this connection error when I try to run my node server on devbox (which never happened before). I'm not sure if this is related but they happened together.

$node-dev app/start.js
Server started on port: 3000
Error: connect ECONNREFUSED
    at errnoException (net.js:901:11)
    at Object.afterConnect [as oncomplete] (net.js:892:19)
    --------------------
    at Protocol._enqueue (/var/www/todo-app-api/node_modules/mysql/lib/protocol/Protocol.js:110:26)
    at Protocol.handshake (/var/www/todo-app-api/node_modules/mysql/lib/protocol/Protocol.js:42:41)
    at Connection.connect (/var/www/todo-app-api/node_modules/mysql/lib/Connection.js:98:18)
    at Object.<anonymous> (/var/www/todo-app-api/app/start.js:39:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Object..js (/usr/local/lib/node_modules/node-dev/lib/hook.js:52:17)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
Jiayang
  • 738
  • 1
  • 7
  • 13

1 Answers1

0

First make sure your files have correct permissions set up.

IIRC everything you do through sshfs by default is made via user fuse, so I would try connecting to sshfs as a concrete user without cache (remove -o cache=yes) and your user's uid and gid. You may also change the encryption algorythm to something faster as this is a dev box. This can be done by:

sshfs -o uid=1000 -o gid=1000 -o ssh_command="ssh -Cc arcfour256" root@zh*****:/var/www www

Replace the uid and gid from your user on the server:

  1. Do cat /etc/passwd on the remote machine
  2. Find your user, will be something like root:x:1000:1000:,,,:...
  3. First integer is the uid and the second one is gid.
  4. Replace them and try remounting sshfs
Sergey Telshevsky
  • 12,077
  • 6
  • 55
  • 78