Exit to Linux shell to install Samba


I have FreepBX Sangoma Linux 7 running locally with FreePBX . On the same server we have a windows IIS machine that we make url requests to. This has our own software running and access the MYSQL on the Linux machine.

We now need to allow our mobile application to listen to the voice recordings. I have googled and believe I have to install Samba to allow a file access.

How do I do this? the Linux box shows pbx login. I presume I have to exit from this and get the the Linux shell.

New to Linux so any help appreciated.

Ok. Understanding more. The login gives me the shell ( I thought it was just fir FreePBX). I am installing samba.

I see the CDR files are stored var/spool/asterisk/monitor then a year folder / month and day.
I can see the recording file for that day.

So I can create a path using the call date eg var/spool/asterisk/monitor/2023/05/27/filename.

Following hers https://www.redhat.com/sysadmin/samba-file-sharing I have installed samba.

Went to var/spool/asterisk/monitor and used sudo mkdir /sambashare

But when I use sudo chcon -t samba_share_t /sambashare/ it says no such file or directory.

I don’t see the folder sambashare If do mkdir /sambashare again it says folder already exists.

What am I missing here please

you need to use ‘properly rooted paths’


Is not the same as


unless you are in


You need samba (CIFS) to ‘share’ the already extant


( re chcon, It is unlikely that SElinux is running on your machine)

I have found the folder under root…

I have followed various tutorials and they say
sudo smbpasswd -a myUserName

I do this and get the prompt to enter password but get the error Failed to add entry for user myUserName

Some tutorials state I have to have Linux user first
So I have used useradd myUserName

I still get Failed to add entry for user myUserName

The issue with the user is solved here:

It turns out that the error message from smbpasswd is not super clear. Also the man page for smbpasswd can be misleading as the -a option seems to suggest that this option will add the user and create a password for that user.

The underlying issue seems to be that smbpasswd only adds users/sets passwords for users already known to the OS. So the right sequence of steps would be:

sudo useradd pi

sudo passwd pi

sudo smbpasswd -a pi

I now have a shared drive working on a windows machine.

I am unable to see the drive in my isapi app under IIS. Working on the issue

Not freepbx related but someone may want to do this.

I now have the voice recording folders shared and available on a windows machine running IIS as P:.

However I cannot see the drive within IIS. I have tried mapping etc changing users etc etc.

Anyone have any experience here please.

Mapped drives are for current logged in user only

IIS runs under a different user so will never see the mapped drive

Use UNC path \\servername\sharename or \\serverIP\sharename

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