LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permissions (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-4175686561/)

Oschallenged 12-09-2020 01:55 PM

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

rtmistler 12-09-2020 02:01 PM

Quote:

Originally Posted by Oschallenged (Post 6193588)
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.

ondoho 12-09-2020 02:29 PM

Quote:

Originally Posted by Oschallenged (Post 6193588)
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

sevendogsbsd 12-09-2020 02:37 PM

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.

Oschallenged 12-09-2020 05:12 PM

permissions
 
Quote:

Originally Posted by ondoho (Post 6193610)
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

rtmistler 12-09-2020 05:27 PM

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?

TB0ne 12-09-2020 05:32 PM

Quote:

Originally Posted by Oschallenged (Post 6193666)
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.

scasey 12-09-2020 05:34 PM

Quote:

Originally Posted by Oschallenged (Post 6193588)
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 (Post 6193666)
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.

berndbausch 12-09-2020 07:36 PM

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.

rtmistler 12-10-2020 09:16 AM

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.

jsbjsb001 12-11-2020 09:42 PM

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.


All times are GMT -5. The time now is 01:53 PM.