Change file owner
After we’ve created the user that will be used to run Asterisk, we need to change the owner of the Asterisk files to match our new user. Execute the following commands:
sudo chown -R asteriskuser:asteriskuser /var/lib/asterisk/
sudo chown -R asteriskuser:asteriskuser /var/spool/asterisk/
sudo chown -R asteriskuser:asteriskuser /var/log/asterisk/
sudo chown -R asteriskuser:asteriskuser /var/run/asterisk/
The chown command is used to change the ownership of a file in Linux. In the example above, we’ve changed both the owner and the group of the file.