Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSHFS doesn't seem to work as expected #1

Open
kourylape opened this issue May 2, 2017 · 8 comments
Open

SSHFS doesn't seem to work as expected #1

kourylape opened this issue May 2, 2017 · 8 comments

Comments

@kourylape
Copy link

kourylape commented May 2, 2017

The environment mounts perfectly, but I cannot edit any of the files because of permission denied. Also the -o IdentityFile=<path_to_key seems to be required otherwise it prompts for your Pantheon account password.

My setup:

OSX: 10.11.6
SSHFS version 2.5 (OSXFUSE SSHFS 2.5.0)
OSXFUSE 3.5.8
FUSE library version: 2.9.7

I get permission denied when trying to edit files when using the plugin as well as:

sudo sshfs -p 2222 -o IdentityFile=<path_to_key>,allow_other,reconnect env.site@appserver.env.site.drush.in:code <local_path>

I get Operation not supported on socket when trying to edit when using:

sshfs -p 2222 -o IdentityFile=<path_to_key>,reconnect env.site@appserver.env.site.drush.in:code <local_path>

Oddly enough, when I use the following and edit a line or two:

vim <local_sshfs_path>/CHANGELOG.txt

It works and uploads fine, but nano, Atom, and PhpStorm have issues.

@uberhacker
Copy link
Contributor

Hey @ckylape: Thank you for the feedback. How did you install sshfs? Did you use brew or some other method? Is this the latest version of the software for your system? If not, you might try updating to the latest version and see if that makes a difference.

@kourylape
Copy link
Author

@uberhacker - I got it from https://osxfuse.github.io/ which was a few versions behind compared to the homebrew package, so I just tried the latest version of sshfs via brew and got the same results.

@uberhacker
Copy link
Contributor

uberhacker commented May 2, 2017

@ckylape: What happens if you try to mount in a directory other than /tmp (the default)? Try something like terminus mount my-site.env --dir=~/.

@kourylape
Copy link
Author

kourylape commented May 3, 2017

Same. I've tried /tmp, /Volumes, and ~/mounts. It's also interesting because I've tested a similar sshfs command on 5+ other sites and everything works fine. These SFTP servers range from AWS EC2, GoDaddy, WP Engine, and a QNAP NAS.

Update:
@uberhacker It seems to be an issue with either my version of OSX or SSHFS. I just tried the same command on a Linux stack and it worked fine. I'm going to try checking on OSX 10.12 as well as SSHFS 2.4 on 10.11 (2.5+ seems to have major changes).

@uberhacker
Copy link
Contributor

Yeah, you might have better luck with older versions. Do you have any trouble connecting to the same site environment using the Terminus Filer Plugin? If not, then the problem is most likely not ssh but rather fuse/sshfs specific.

@kourylape
Copy link
Author

kourylape commented May 4, 2017

@uberhacker It seems like it's an issue with Pantheon's servers and sshfs on OSX. I tried the following:

  • OSX - 10.11 and 10.12
  • SSHFS - 2.4.1, 2.5, 2.9

The plugin (or raw sshfs commands) did not work on any of those versions.

I did get it to work though after adding -o workaround=truncate to sshs. I will have to do some more testing, but it might also need the rename workaround. I'm thinking that it's a server issue since the man sshfs shows:

-o workaround=LIST
    colon separated list of workarounds

    none   no workarounds enabled

    all    all workarounds enabled

    [no]rename
         fix renaming to existing file (default: off)

    [no]nodelaysrv
        set nodelay tcp flag in ssh (default: off)

    [no]truncate
        fix truncate for old servers (default: off)

    [no]buflimit
        fix buffer fillup bug in server (default: on)

My final command looks like:

sshfs -o IdentityFile=<PATH_TO_KEY>,allow_other,reconnect,workaround=truncate -p 2222 <ENV>.<SITE_UID>@appserver.<ENV>.<SITE_UID>.drush.in:code ~/

@uberhacker
Copy link
Contributor

Nice find. I suppose it wouldn't hurt if you just used workaround=all? Not sure why you would need the IdentityFile=... option since the default is ~/.ssh/id_rsa.

@kourylape
Copy link
Author

The IdentityFile seems to required with older versions of sshfs (2.5 and lower - at least on OSX). The nodelaysrv seems to slow down the connection IMO so the workaround=truncate:rename seems a little better. Thanks for the feedback/help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants