Can't see EC2 files in RStudio server

I recently installed an RStudio server on my Amazon EC2 instance. I typically use the default ec2-user with a key to SSH into the instance, but I created a separate user named rstudio with a password to log into the RStudio server in my browser. I can log in successfully, but after doing so, I don't see any files in the bottom right pane of RStudio even though there are many directories and subdirectories of files in /home/ec2-user.

I thought this was possibly because there were no files in /home/rstudio (indeed, that directory didn't even exist even after creating the rstudio user) but even after creating it and moving a file there, that file does not seem to be accessible in RStudio. Any idea what I'm doing wrong?

My understanding is that you can view these files as ec2-user but not as your rstudio user?
If that is the case it sounds like your rstudio user does not have permission to view those files.

If I was you, I would run an ls -al command to confirm the permissions of these files, and then (presuming that your rstudio user doesn't have permission to view) run a chown and/or chmod command as suits your use-case best.

No, I can't even use ec2-user and its associated password to log into rstudio--it says "Error: Incorrect or invalid username/password" when I try. The only time I can see any files is when I ssh into the instance with ec2-user and its key.

Have you tried ssh'ing via ec2-user and running ls -al /path/to/folder/with/files/rstudio/is/not/showing?

This will list the permissions of your files and who can view it. https://chmodcommand.com/ is a useful learning tool. If you are not familiar with chmod, chown, and Linux user groups it would be useful to research these. (I'm making a presumption here as part of the troubleshooting process, so apologies if you are already fully familiar with everything I've mentioned?)

Could you ssh in as ec2-user, switch to your rstudio user (su - rstudio) and try to list your files? I'm presuming that you won't be able to list them as your user won't have permission. If that's the case you'll want to change your permissions and/or ownership (ie. chmod and/or chown {or maybe even create a user group for all your Rstudio Server users and apply that})

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.