LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2016, 01:03 PM   #1
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Rep: Reputation: 49
File permissions question - Cento & Ubuntu / same file / same permissions but...


Hello:

Using nano /etc/asterisk/manager.conf (as user root) on Centos 6.x allows me to make and save changes, but, nano /etc/asterisk/manager.conf (as user root) on Ubuntu Server 14.04 does not allow me to save changes: "error writing manager.conf - Permission denied"

Centos ls -l manager.conf : -rw-rw-r-- 1 asterisk asterisk 1113 Mar 10 12:57 manager.conf
Ubuntu ls -l manager.conf : -rw-rw-r-- 1 asterisk asterisk 930 Mar 3 10:45 manager.conf

Does anyone know how this can be? Is there a way to allow changes to be written to the Ubuntu file?

Thanks,

Last edited by Robert.Thompson; 03-12-2016 at 01:44 PM.
 
Old 03-12-2016, 03:06 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Extended attributes?
 
Old 03-13-2016, 09:24 AM   #3
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by Emerson View Post
Thanks Emerson.

I think that "Extended attributes" may be beyond my abilities - they seem like Linux programming functions or something like that.

It could be something that I did, or did not, do correctly following a tutorial on how to install A2Billing on a PBX running on a Ubuntu server. I may just try the install process again to see if that is the case.
 
Old 03-13-2016, 10:03 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Normally root is disabled in Ubuntu and its derivatives. To edit files that require root access you would use sudo and your regular username password.

sudo nano filename
 
Old 03-13-2016, 10:42 AM   #5
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Thanks michaelk.

Have tried that but got the same error msg.

Did: su asterisk and then tried to nano the file - same error msg.

One of the instructions in the tutorial was to do chmod 777 /etc/asterisk -R but I got this output

root@sPbx:/# chmod 777 /etc/asterisk -R
chmod: changing permissions of ‘/etc/asterisk/manager.conf’: Operation not permitted
chmod: changing permissions of ‘/etc/asterisk/manager.conf.bak’: Operation not permitted
chmod: changing permissions of ‘/etc/asterisk/manager_custom.conf’: Operation not permitted
chmod: changing permissions of ‘/etc/asterisk/manager_additional.conf’: Operation not permitted
root@sPbx:/#

The directory of /etc/asterisk contains a bunch of files & sub-directories, but only the above 4 files failed the operation.

I think that this is weird but I am no expert.


root@sPbx:/etc/asterisk# ls
acl.conf cdr_sqlite3_custom.conf console.conf freepbx_menu.conf.template logger.conf osp.conf res_fax_custom.conf sip_notify_custom.conf
additional_a2billing_iax.conf cdr_syslog.conf dbsep.conf freepbx_module_admin.conf logger_general_additional.conf oss.conf res_fax_digium.conf sip_notify_endpointman.conf
additional_a2billing_sip.conf cdr_tds.conf dnsmgr.conf func_odbc.conf logger_general_custom.conf phone.conf res_fax_digium_custom.conf sip_registrations.conf
adsi.conf cel.conf dsp.conf func_odbc.conf.1 logger_logfiles_additional.conf phoneprov.conf res_ldap.conf sip_registrations_custom.conf
agents.conf cel_custom.conf dundi.conf globals_custom.conf logger_logfiles_custom.conf phpagi.conf res_odbc_additional.conf skinny.conf
alarmreceiver.conf cel_custom_post.conf enum.conf gtalk.conf manager_additional.conf privacy.conf res_odbc.conf sla.conf
alsa.conf cel_general_additional.conf extconfig.conf gtalk.conf.old manager.conf queuerules.conf res_odbc.conf.old smdi.conf
amd.conf cel_general_custom.conf extensions_additional.conf h323.conf manager.conf.bak queues_additional.conf res_odbc_custom.conf telcordia-1.adsi
app_mysql.conf cel_odbc.conf extensions.ael http_additional.conf manager_custom.conf queues.conf res_pgsql.conf tm4
app_skel.conf cel_odbc_custom.conf extensions.conf http.conf meetme_additional.conf queues_custom.conf res_pktccops.conf udptl.conf
asterisk.adsi cel_pgsql.conf extensions_custom.conf http_custom.conf meetme.conf queues_custom_general.conf res_snmp.conf udptl_custom.conf
asterisk.conf cel_sqlite3_custom.conf extensions_custom.conf.sample iax_additional.conf mgcp.conf queues_general_additional.conf res_stun_monitor.conf unistim.conf
backup cel_tds.conf extensions.lua iax.conf minivm.conf queues_post_custom.conf rtp_additional.conf users.conf
calendar.conf chan_dahdi_additional.conf extensions_minivm.conf iax_custom.conf misdn.conf res_config_mysql.conf rtp.conf version
ccss.conf chan_dahdi.conf extensions_override_freepbx.conf iax_custom_post.conf modem.conf res_config_sqlite3.conf rtp_custom.conf vm_email.inc
ccss_general_additional.conf chan_dahdi.conf.template features_applicationmap_additional.conf iax_general_additional.conf modules.conf res_config_sqlite.conf say.conf vm_general.inc
ccss_general_custom.conf chan_mobile.conf features_applicationmap_custom.conf iax_general_custom.conf motif.conf res_corosync.conf sip_additional.conf voicemail.conf
cdr_adaptive_odbc.conf cli_aliases.conf features.conf iaxprov.conf motif.conf.bak res_curl.conf sip.conf voicemail.conf.template
cdr.conf cli.conf features_featuremap_additional.conf iax_registrations.conf motif_custom.conf res_digium_phone_additional.conf sip_custom.conf vpb.conf
cdr_custom.conf cli_permissions.conf features_featuremap_custom.conf iax_registrations_custom.conf musiconhold_additional.conf res_digium_phone_applications.conf sip_custom_post.conf xmpp.conf
cdr_manager.conf codecs.conf features_general_additional.conf indications.conf musiconhold.conf res_digium_phone.conf sip_general_additional.conf xmpp.conf.bak
cdr_mysql.conf confbridge_additional.conf features_general_custom.conf jabber.conf musiconhold_custom.conf res_digium_phone_devices.conf sip_general_custom.conf xmpp_custom.conf
cdr_mysql.conf.bak confbridge.conf festival.conf jabber.conf.old muted.conf res_digium_phone_firmware.conf sip_nat.conf xmpp_general_custom.conf
cdr_odbc.conf confbridge_custom.conf followme.conf jingle.conf odbc.conf res_digium_phone_general.conf sip_notify_additional.conf zapata.conf.template
cdr_pgsql.conf config_test.conf freepbx_featurecodes.conf.template localprefixes.conf ooh323.conf res_fax.conf sip_notify.conf
root@sPbx:/etc/asterisk#
 
Old 03-13-2016, 10:56 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Once your root you should be able to su to the asterisk user and then modify the file. Not sure why you can't as root at the moment.
 
Old 03-13-2016, 11:11 AM   #7
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by michaelk View Post
Once your root you should be able to su to the asterisk user and then modify the file. Not sure why you can't as root at the moment.
Thanks michaelk.

I did this:

root@sPbx:/etc/asterisk# su root
root@sPbx:/etc/asterisk# su asterisk
asterisk@sPbx:/etc/asterisk$ nano manager.conf

but got the same error msg when I tried to save the file.

BTHOOM!
 
Old 03-13-2016, 01:01 PM   #8
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can check if immutable bit is set with lsattr command and change it with chattr command. Just something to check, not sure why immutable bit should be set in first place.
 
Old 03-13-2016, 09:11 PM   #9
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by Emerson View Post
You can check if immutable bit is set with lsattr command and change it with chattr command. Just something to check, not sure why immutable bit should be set in first place.
Thanks Emerson, I think that you've found the problem:

root@sPbx:/etc/asterisk# lsattr manager.conf
----i--------e-- manager.conf
root@sPbx:/etc/asterisk#

So, it is safe just to remove this? (# chattr -i manager.conf)
 
Old 03-13-2016, 10:08 PM   #10
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Try it. Some applications may check permissions and fail to run if permissions are not what expected. Anyhow, you can unset it, edit the file and set it back.
 
Old 03-17-2016, 09:49 AM   #11
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Thanks Emerson, your suggestion worked in that it allows me to make and save changes.

(Unfortunately, my attempt to install A2Billing on my Digital Oceans Ubuntu server continues to give me grief.)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] File permissions & Group membership questions - Ubuntu 15.04 taylorkh Linux - Newbie 8 08-12-2015 03:11 PM
File recovery & permissions Slay3r_ Linux - Newbie 1 10-18-2012 03:15 PM
Samba & File permissions reticent Linux - Server 2 11-12-2011 05:12 AM
File & directory permissions waynevnc Debian 5 07-06-2004 02:29 PM
file & dir permissions lnxDE Linux - Newbie 2 05-27-2002 02:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration