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

Minor fixes to support AWS Transfer (sftp access to S3)? #55

Open
PenelopeFudd opened this issue May 1, 2020 · 1 comment
Open

Minor fixes to support AWS Transfer (sftp access to S3)? #55

PenelopeFudd opened this issue May 1, 2020 · 1 comment

Comments

@PenelopeFudd
Copy link

Hi;

I'm attempting to mount an S3 bucket on my MacOS 10.15.4 (Catalina), and so far s3fs and yas3fs have failed in various ways. Sshfs almost works, but dies with the following error:

$ sshfs -d ucat: ucat-folder/ -o idmap=user,nomap=ignore,workaround=nofstat,sshfs_debug

SSHFS version 2.10
FUSE library version: 2.9.7
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-2> <ucat> <-s> <sftp>
Server version: 3
unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 5935
INIT: 7.19
flags=0xf8000008
max_readahead=0x00100000
failed to detect remote user ID
   INIT: 7.19
   flags=0x00000010
   max_readahead=0x00100000
   max_write=0x02000000
   max_background=0
   congestion_threshold=0
   unique: 2, success, outsize: 40
unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 0
statfs /
Floating point exception: 8

As this is AWS, they're a bit like Apple, in that they "Think Different". Here's what I see when using sftp manually:

$ sftp ucat
Connected to ucat.
sftp> dir
foobar
sftp> ls -la
drwxr--r--   1        -        -        0 Jan  1  1970 foobar
sftp> df
Server does not support statvfs@openssh.com extension
sftp>

Perhaps the problem is in the sshfs_statfs function?

For testing, these commands will set up an AWS Transfer server and user:

 aws transfer create-server --output=text

 aws transfer create-user \
  --role arn:aws:iam::0000000000:role/cross-account/Account-ReadOnly \
  --server-id s-00000000000 \
  --user-name your_username \
  --home-directory '/your-s3-bucketname/your-folder-well-prefix-actually/'

 aws transfer import-ssh-public-key \
  --server-id s-000000000 \
  --user-name your_username \
  --ssh-public-key-body "$(cat ~/.ssh/id_rsa.pub)"

cat <<'EOF' >> ~/.ssh/config
Host ucat
  User your_username
  Hostname s-0000000000000.server.transfer.us-west-2.amazonaws.com
  IdentityFile ~/.ssh/id_rsa
EOF

sftp ucat
Connected to ucat.
sftp>

Thanks!

@PenelopeFudd
Copy link
Author

Here's the full debug log from:

sshfs -d ucat: ucat-folder/ -o idmap=user,nomap=ignore,workaround=nofstat,sshfs_debug,loglevel=debug,debug

Note, I also tried with just sshfs_debug,loglevel=debug,debug, same results.

a.txt

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

1 participant