Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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?
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.
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
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.
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.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.