Changed recording location and now Asterisk user gets permission denied

Freepbx 14
Asterisk 13

I created a windows share on one of my file servers and then mounted that share on FreePBX server to /mnt/recordings

I then changed the location in advanced settings to point to that location. The problem is nothing is getting recorded there.

I Putty’d in to the server as Asterisk user and I get permission denied when trying to create a test text file in there. Root user has no problem creating files in that location. I’ve tried all the chmod commands and chown commands and that folder sill only shows root as having permissions.

What could I be doing wrong here?

How did you mount that share? Is it permanently mounted in your /etc/fstab, and what are the options for it? What are the permissions for /mnt/recordings set as? What are the permissions for the parent directory (like if you type ‘ls -l /mnt’)? Try editing the permissions for the /mnt folder or check how the share is being mounted.

Here’s the command I used to mount it once:

sudo mount.cifs -v //10.20.3.46/Centralized-Call-Recordings/recordings /mnt/recordings --verbose -o user=pbxadmin,password=*******,domain=FS-SVR2-SUP

I had to create a local account on the domain joined file server called “pbxadmin” before it would even mount the first time.

Here’s what I added in fstab (but I don’t know if it’s right because I haven’t rebooted it yet):

\10.20.3.46\Centralized-Call-Recordings\recordings /mnt/recordings user=pbxadmin,password=*********,domain=FS-SVR2-SUP 0 0

Here are the permissions for /mnt:

[root@central ~]# ls -l /mnt/
total 0
drwxr-xr-x 2 root root 0 Jun 27 17:36 recordings

chmod -R 777 /mnt/recordings

Already tried that. Asterisk user still cannot create a file in there.

root@central ~]# ls -l /mnt/
total 0
drwxr-xr-x 2 root root 0 Jun 27 17:36 recordings

Says that you have not, only root has full rights asterisk can read but not write, you want

drwxrwxrwx 2 root root 0 Jun 27 17:36 recordings

(true a little too permissive , but . . . )

I ran this command as root:
chmod -R 777 /mnt/recordings

no errors. Then I ran the “ls -l /mnt/” command and pasted the results here.

[root@central ~]# chmod 777 /mnt/recordings
[root@central ~]# ls -l /mnt/
total 0
drwxr-xr-x 2 root root 0 Jun 27 17:36 recordings
[root@central ~]#

try adding noperm to your mount options

(I hate cifs :wink: )

same thing. Permission denied when Asterisk user tries to create a text file.

Everything I read about mounting a windows file share said I needed cifs. Is there a better way?

If you install the linux subsystem, you can Use sshfs (or possibly nfs if on the same network)

I looked at a very old system where I had uid=1001.gid=1001 which was my asterisk user

https://www.samba.org/~ab/output/htmldocs/manpages-3/mount.cifs.8.html

I fixed it by changing the mount command to:

mount -t cifs -o username=pbxadmin,password=********,dir_mode=0777,file_mode=0777,nounix //10.20.3.46/Centralized-Call-Recordings/recordings /mnt/recordings

1 Like

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