LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-09-2020, 01:55 PM   #1
Oschallenged
LQ Newbie
 
Registered: Dec 2020
Location: Pennsylvania, USA
Distribution: presently Ubuntu
Posts: 2

Rep: Reputation: Disabled
permissions


I am reacquainting myself with linux after many years away and having a harder time. I was always under the impression that when you loaded a distro that the name and password you entered made you the administrator, root, superuser, or whatever other name you want to use AND that these were all considered to be the same entity and if not why not. I am on my 2nd distro because that one and this one denied me editing smb.conf.The previous distro denied me ,while i was logged as SU to edit smb.conf because i was not the 'owner' of the file, root was the owner. This distro tells me that the file is read only after invoking su -i and while letting me modify the file denies me saving because it is read only. I am up to my eyeballs with this permissions nonsense

Last edited by Oschallenged; 12-09-2020 at 03:34 PM. Reason: update
 
Old 12-09-2020, 02:01 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Oschallenged View Post
I am reacquainting myself with linux after many years away and having a harder time. I was always under the impression that when you loaded a distro that the name and password you entered made you the administrator, root, superuser, or whatever other name you want to use AND that these were all considered to be the same entity and if not why not. I am on my 2nd distro because that one and this one denied me editing smb.conf.The previous distro denied me ,while i was logged as SU to edit smb.conf because i was not the 'owner' of the file, root was the owner. This distro tells me that the file is read only after invoking su -i and while letting me modify the file denies me saving because it is read only. I am up to my eyeballs with this permissions nonsense
root can edit a file like smb.conf, but many of the critical files are chmod'ed to be read only so that you don't inadvertently mess them up. You can always chmod it to be writeable, edit it, and chmod it back to be read only. That's what I do, but there's also a some other type of edit command, gksudo or gkedit, something like that. As you can see, I didn't bother learning it, instead I change the r/w permissions, edit, and then change them back.
 
2 members found this post helpful.
Old 12-09-2020, 02:29 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Oschallenged View Post
I am up to my eyeballs with this permissions nonsense
It's a feature, not a bug!
Time to take a deep breath and read up on it: https://duckduckgo.com/?q=linux+file...ions+explained
 
2 members found this post helpful.
Old 12-09-2020, 02:37 PM   #4
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Normal distro installs do not make you root at all, but that depends on the distro. Ubuntu gives the user sudo access and others force you to create a normal user and ask whether you want to enable root.

Don't get frustrated at permissions: normally you have to do nothing with permissions to use the system, as a desktop for example. In your example, su or sudo will work after configuration. Again, this depends on the distro.
 
4 members found this post helpful.
Old 12-09-2020, 05:12 PM   #5
Oschallenged
LQ Newbie
 
Registered: Dec 2020
Location: Pennsylvania, USA
Distribution: presently Ubuntu
Posts: 2

Original Poster
Rep: Reputation: Disabled
permissions

Quote:
Originally Posted by ondoho View Post
It's a feature, not a bug!
Time to take a deep breath and read up on it: https://duckduckgo.com/?q=linux+file...ions+explained
No...if it prevents me from having a working system it is a bug
 
Old 12-09-2020, 05:27 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Now that you have been advised that you can use sudo or edit as the root user, as well as needing to change the r/w attributes of the file, is there anything further blocking you?
 
1 members found this post helpful.
Old 12-09-2020, 05:32 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,638

Rep: Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966
Quote:
Originally Posted by Oschallenged View Post
No...if it prevents me from having a working system it is a bug
Sorry, no...it prevents someone who *DOESN'T KNOW WHAT THEY'RE DOING* from breaking a system. If you don't understand the permissions, and ways to safely do what you need to, you don't need to be changing it in the first place. Sorry if that sounds harsh, but it's true. It's a 'bug' in the same way there are different nozzle sizes for gasoline versus diesel. You can't do it without breaking something, and if you don't know WHY you shouldn't do it, removing it is a dumb idea.

Permissions and privilege separation is exactly what makes Unix/Linux safe(r), and Windows horribly insecure. I use openSUSE...separate root and 'normal' user, so I *COULD* log in as root, but I don't. Extra steps to edit system config files? Sure...safety net in case I fat-finger something? Absolutely.

You seem to be determined to say how bad this is, despite having many paths to easily accomplish what you're after, so I'm not sure what the purpose of your thread is. If using Linux is too 'hard' and has these 'bugs' you don't like, there's nothing keeping you using it.

Last edited by TB0ne; 12-09-2020 at 05:34 PM.
 
6 members found this post helpful.
Old 12-09-2020, 05:34 PM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,728

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by Oschallenged View Post
I was always under the impression that when you loaded a distro that the name and password you entered made you the administrator, root, superuser, or whatever other name you want to use AND that these were all considered to be the same entity...
That was a very mistaken impression. There is typically only one superuser, called root. UID 0. It’s the way all *nix flavors work.
Quote:
Originally Posted by Oschallenged View Post
No...if it prevents me from having a working system it is a bug
It doesn’t prevent you having a working system; as posted, you will need to learn how to use sudo or su. If you are correctly using su, you will be able to edit a file owned by root.

If that didn’t work for you, please share the exact commands you entered and the exact results you got.
 
3 members found this post helpful.
Old 12-09-2020, 07:36 PM   #9
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I just want to point out that su -i doesn't work anyway:
Code:
# su -i
su: invalid option -- 'i'
...
Same on Centos 7 and OpenSuse 15.1.

Also, when you use vim to edit smb.conf and smb.conf has read-only permissions, you get this when trying to save the file:
Code:
E45: 'readonly' option is set (add ! to override)
If you have superuser privileges, the exclamation mark enables you to save the file.

In short, it is not quite clear to me what exactly OP is doing to edit smb.conf.
 
1 members found this post helpful.
Old 12-10-2020, 09:16 AM   #10
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Oschallenged did not start declaring that there was a bug at all, they stated that it's been many years and they're having a hard time.

I'd recommend against distribution swapping due to these frustrations.

Once again, there usually is a way to act as root, using the sudo command, or log in as root. Some distributions try to limit this as much as possible to protect the unwary.

Further, I have found that certain files are made to be read-only to protect them the same way, but this attribute can be altered so that the files can really be edited.

To check the ownership, group, and file permissions:
Code:
$ ls -l <filename>
That will show you all. There are commands for changing the rwx access, that one is chmod, and one for changing the owner and group, that is chown.

For system files, I'd recommend leaving those as owned by root and not changing the group.

If you really need to edit system files, this is possible, and is a thing which people still do, but you should examine the situation, make a backup of the original file, perform your edits using the root user and any needed chmod commands, and then test it out. If you didn't get it correct, you still have the original file to restore.

If you have problems performing this, it is helpful to stop, record what you've done, where problems did occur and identify the distribution you are using. Then people can give more specific information to aid you.
 
3 members found this post helpful.
Old 12-11-2020, 09:42 PM   #11
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
You could always setup a virtual machine if you want to change something system-related, but aren't sure about how to do it properly.

If I want to change something or do something and I'm worried about breaking my system; I'll setup a virtual machine, then create a snapshot/backup of it before I do anything. Unless I know beforehand I can still dig myself out of whatever hole I end up in if I end up breaking something. That way I don't care if I mess something up, because it's not my "real" system at stake.

So just do that if it's something you're not sure about/still learning, that has the potential to break your system if you get it wrong. Using VM's are a great way to learn without risking your "real" system.
 
1 members found this post helpful.
  


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] Permissions Permissions Permissions! makem Linux - Newbie 13 07-30-2015 11:54 AM
Permissions...Permissions GTrax Linux - Software 5 09-06-2007 08:03 PM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 12:00 PM
permission ... permissions .... permissions alaios Linux - General 1 05-31-2005 04:16 AM
getting a directory's permissions and creating a new one with the same permissions newbie1000101 Programming 1 04-10-2004 12:52 PM

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

All times are GMT -5. The time now is 11:30 AM.

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