I have an S3 bucket mounted on my server. It was mounted as root.
I need to make all files within certain folders within the bucket owned by another user by default because when I try to perform operations on that directory as that user, it says access denied.
I tried:
sudo setfacl -Rdm u:newuser:rwx /path/to/directory/
I also unmounted the bucket, then logged in as that user and tried to remount it, but because that user didn't have access to the password file it didn't work either.
Do I have to just give that user permissions on the password file?
Is there any other way to do this? Open to any other solutions.
I am trying to do:
scp ec2-user#php-pos-web-1:/var/log/httpd/* tmp/php-pos-web-1;
I get permission denied because those files are owned by root. I don't want to enable root login. Is it ok if I change the group for that folder? What is the best way?
I am on amazon linux
It is generally not a good idea to change the permissions to system folders. They are not world-readable for a reason. They can expose potentially sensitive data (accessed pages, clients IP addresses, ...).
You should on the other way copy the files to some some accessible location (/tmp) using sudo and then copy them over the network back.
I am trying to use sf3f (https://github.com/s3fs-fuse/s3fs-fuse to handle files being uploaded by a different process to an s3 bucket. I can see files listed when I ls in hat mounted directory and the files are showing correctly timestamped and with the correct size. But trying to open the files either in code or using vi or nano just shows garbage such as
^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#
If I curl the s3 link then I do see content so it is available and there do not seem to be permission issues.
I am able to create a new file in this directory and the content is saving fine - can view it in the S3 explorer.
Any thoughts? Is this an s3fs-fuse problem and I may fair better using an alternate such as https://github.com/kahing/goofys?
I have signed up for the AWS EFS preview but no idea what the wait time is for that.
I am setting up a multimedia server on Debian 8.
I installed both Plex and Owncloud. I have set up /var/media as my Owncloud default folder. I decided to create a folder Library at the root of Owncloud. So the folder path is:
/var/media/admin/files/Library
I changed the permissions of media with:
chmod 770 -R /var/media
On top of that, all the files in /var/media are owned by www-data:www-data.
In order to make Plex see my medias, I have added the user plex to the group www-data. I would like to create a library watching my /var/media/admin/files/Library folder but I have a problem, Plex doesn't see neither the files or folders in /var/media. Here is a screenshot:
To finish, I have tried to connect on my server via ssh with the plex user, and it sees files and folders inside /var/media.
What am I doing wrong? Maybe it is not a permission issue?
Thanks
Update
If I change the ownership of /var/media to plex:www-data, it works. But I can't understand why it doesn't work for www-data:www-data. So it is well a permissions issue.
If I launch id plex, I have:
uid=107(plex) gid=33(www-data) groups=33(www-data)
Just to remind, here are the permissions of /var/media folder (full permissions for group...):
drwxrwx--- 4 www-data www-data 4096 Oct 30 09:01 media
I assume from your post that Plex, Linux OS, and your media are all contained on the same machine and that there are no separate computing devices being used here as that would mean additional steps are required.
In all likelyhood, plex won't be able to list your files because the mode 777 is required to list files in a directory even if the files themselves are set more restrictively than 777 e.g. 750. From what I can tell, your chmod command has set all the directory permissions to 770 which would break the listing capability. As it happens I've just yesterday written a guide over on Tech-KnowHow that covers this, and within that I have described how to set all your folders to 777 and your files to something else. That way it works with plex (and other systems for that matter). I've essentially chosen the same solutions as you in that I use the group to assign the permissions and make sure the everyone / other mode is set to apply no permissions.
There's a direct link to the article below, you'll need to click on the implementation page and look for the find command under the 'Apply correct modes' heading. I've also included how to keep your ownership consistent through samba which is useful when copying new files across. Let me know how that goes in the comments and I'll help you out where I can while it's still fresh in my mind. Good luck!
https://www.tech-knowhow.com/2016/03/how-to-plex-permissions-linux/
I know it is an old post, but I had the same issue and this was my solution :
After a
sudo service plexmediaserver status
I found the file used to launch the plex service /lib/systemd/system/plexmediaserver.service. This file contains the user and group which are used by plex.
So we can change the line Group=plex by your group.
PS: do not forget to restart the plex service with
sudo service plexmediaserver restart
I'm trying to mount the s3 directory to my EC2 instance. I'm getting everything to work except my user is not able to write to the mounted directory. I even ran with the allow_other permission set. Is there something else?
I created the directory and made sure the permission was there for my current user
I then mounted the s3 bucket using the allow_other option
My user is able to read but not write...
Is there something else I need to do? I read the following sites for this:
https://code.google.com/p/s3fs/issues/detail?id=185
http://xentek.net/articles/448/installing-fuse-s3fs-and-sshfs-on-ubuntu/
http://michaelaldridge.info/post/12086788604/mounting-s3-within-an-ec2-instance
I honestly have no clue what happened. But I restarted my EC2 instance and ran the above again and it worked perfectly.