LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-28-2015, 07:53 AM   #1
Daughty
LQ Newbie
 
Registered: May 2015
Posts: 12

Rep: Reputation: Disabled
Angry Permissions


Hey everyone, am logged in as one of the admins in a database yet I cannot not go to /etc/yum.conf
Every time I try, it says permission denied.

What am I missing out? Kindly assist.
 
Old 05-28-2015, 07:55 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
usually those files (/etc/*.conf) can only be edited by root, noone else.
 
Old 05-28-2015, 07:59 AM   #3
Daughty
LQ Newbie
 
Registered: May 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
pan64, thank you.
I actually changed to root...su root...but still cannot view.
 
Old 05-28-2015, 08:05 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
try "su -" to root.

You didn't say what system you are on, but those using SELinux recognize the difference between the real UID and effective UID. For normal DAC access, the effective UID is sufficient. But with SELinux active you also have to have the appropriate security label.

Last edited by jpollard; 05-28-2015 at 08:06 AM.
 
Old 05-28-2015, 08:05 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
what will respond: ls -l /etc/yum.conf ?
 
Old 05-28-2015, 08:09 AM   #6
Daughty
LQ Newbie
 
Registered: May 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Still the same thing...permission denied.
 
Old 05-28-2015, 08:09 AM   #7
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
what are parent directories and files permissions of those concerned files.
 
Old 05-28-2015, 08:16 AM   #8
Daughty
LQ Newbie
 
Registered: May 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Am on centOs, the home directory is /etc/
 
Old 05-28-2015, 08:41 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
You need the security labels. Use "su -" to go to root on CentOS.
 
Old 05-28-2015, 08:55 AM   #10
Daughty
LQ Newbie
 
Registered: May 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
[me@my_DB1 ~]$ su -
Password:
[root@my_DB1 ~]# /etc/resolv.conf
-bash: /etc/resolv.conf: Permission denied
[root@my_DB1 ~]#


This is what I get. Am stuck
 
Old 05-28-2015, 08:59 AM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by Daughty View Post
[me@my_DB1 ~]$ su -
Password:
[root@my_DB1 ~]# /etc/resolv.conf
-bash: /etc/resolv.conf: Permission denied
[root@my_DB1 ~]#

This is what I get. Am stuck
...and you're stuck because you're not trying to VIEW that file, you're trying to EXECUTE IT. It's a text file, not a program. Try running "cat /etc/resolv.conf", to display it to the screen, or "<whatever editor you want> /etc/resolv.conf" to edit the file.

Be aware that if you don't know how to view a text file, you probably shouldn't be editing system files, unless you are SURE you have backups, and are SURE of what you're doing.
 
Old 05-28-2015, 09:07 AM   #12
Daughty
LQ Newbie
 
Registered: May 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
TB0ne, thank you. What I have pasted here is from the command I ran. ..and yes, I want to edit the text file so how do I find my way there? I actually did "/etc/resolv.conf" as you put it but its not displaying the content....cat /etc/resolv.conf only gives me the nameserver, that is not what I want. I want the text file so that I be able to edit it. Yes I have been authorized to so.
 
Old 05-28-2015, 09:11 AM   #13
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
you need to use an editor. Either on the GUI in that case I suggest gedit or in console. In that case you can try vi, mcedit, nano or any other (which is available)

resolv.conf usually contains only the nameserver, so that was the whole content. cat printed everything.

Last edited by pan64; 05-28-2015 at 09:13 AM.
 
Old 05-28-2015, 09:13 AM   #14
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
BTW, since you are on CentOS, you don't want to edit the /etc/resolv.conf file.

It gets overwritten by NetworkManager on boot... and the contents are specified elsewhere, and in a different form (the network configuration files...)
 
Old 05-28-2015, 09:18 AM   #15
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
originally that was yum.conf. I do not know how it was changed...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Samba and permissions ( permissions seems ok but wont work anyway ) spooksman Linux - Networking 1 04-10-2014 10:58 AM
setfacl changes group permissions; giving another user rw permissions secretlydead Linux - Server 4 09-23-2012 12:12 AM
relation between programs permissions and permissions of the files they use rblampain Linux - Security 1 07-10-2011 09:40 PM
[SOLVED] filesystem permissions question - making so user can't change permissions? c0pe Linux - Security 4 07-12-2010 10:06 AM
[SOLVED] Lack basic understanding of permissions(apache permissions problem) cK` Linux - Newbie 7 04-09-2010 12:49 AM


All times are GMT -5. The time now is 06:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration