0

I am setting up my home camera to record to my NAS server (CentOS 8 Stream). I am using FTP for the transfer. I installed vsftpd and created a dedicated user (ftpuser). I want the files to be transferred to /data/recordings, which is also a Samba share: \mynas\recordings.

When I set the destination for the FTP transfer from the camera's UI it always assumes I am starting from the user's home directory. So /data/recordings/camera1 becomes /home/ftpuser/data/recordings/camera1. There is no way to change this behavior.

As a workaround I changed ftpuser's home directory to /data/recordings. This will only work if I set the label for the recordings folder to user_home_dir_t:

semanage fcontext -a -t user_home_dir_t /data/recordings
restorecon -F -R -v /data/recordings

The problem is that breaks the Samba share because the label was originally samba_share_t.

If I turn off SELinux everything works perfectly, so the issue is 100% the labeling of the folder.

I've done some googling and it looks like using a boolean might be the solution, but I can't figure out which one to use. I've tried a couple, but nothing seems to make a difference. Any assistance would be great.

Thanks!

2
  • sudo setsebool -P samba_export_all_ro=1; sudo setsebool -P samba_export_all_rw=1 Commented Jun 21, 2022 at 18:17
  • This resolved the issue. I can't mark it as an accepted answer though :( Commented Jun 21, 2022 at 20:19

1 Answer 1

0

This should solve it without the need to change the security context of files:

sudo setsebool -P samba_export_all_ro=1
sudo setsebool -P samba_export_all_rw=1

(probably the second command alone is enough, I've not tested).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .