shiny-server can't download file from from S3 to AMI

113 views
Skip to first unread message

anny9699

unread,
Mar 10, 2015, 4:40:41 PM3/10/15
to shiny-...@googlegroups.com
Hi,

I installed shiny-server on aws AMI. When I tried to download file from s3 using

system("s3cmd get path-to-file")

It failed, and gave me the error "ERROR: Skipping path-to-file: Permission denied". However when I asked only to list files, such as

system("s3cmd ls path-to-file")

it was working fine. Also when I was downloading files from terminal or rstudio server or R console (installed on the same AMI) it could also download. So I assume it was due to some shiny-server permission issue. I changed the "run as" to root, but it still failed to download.

Could anyone have some suggestions on this?

Thanks a lot!

Joe Cheng

unread,
Mar 10, 2015, 7:14:08 PM3/10/15
to anny9699, shiny-...@googlegroups.com
Shiny Server won't run apps as root (at least I don't think so).

If you really want to do this, you need to make sure the "shiny" user has write permissions to path-to-file. I'd encourage you to limit the write permissions to the minimal set of directories that are necessary (e.g. don't let the app itself be modified by the "shiny" user, just a specific directory where the data will live).

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/8739c841-9b42-450d-b9e3-3157f7b5a7b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anny Chen

unread,
Mar 10, 2015, 7:21:06 PM3/10/15
to Joe Cheng, shiny-...@googlegroups.com
Hi Joe,

Thanks for the explanation. However I could download the file from rstudio server (through browser on my local machine) . So rstudio server has the permision but shiny-server doesn't have? 

Also I didn't limit permission on the users as long as they have the access key and access secret key for the s3 bucket. Is there some place in shiny-server that I should specifically set permission? 

Thanks a lot!

Joe Cheng

unread,
Mar 10, 2015, 7:25:01 PM3/10/15
to Anny Chen, shiny-...@googlegroups.com
Your RStudio Server runs with the permissions of your user account. Shiny Server (by default) runs as a low-privileged user named "shiny", this is because it's expected to face less trusted traffic than RStudio Server.

The permission isn't in shiny-server itself; it's on the filesystem. Can you run this command from the shell?

ls -ld path-to-data-directory

where path-to-data-directory is replaced with the directory where your data should live?
Reply all
Reply to author
Forward
0 new messages