LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2018, 03:00 AM   #1
Osmium_Dresden
LQ Newbie
 
Registered: Mar 2018
Posts: 2

Rep: Reputation: Disabled
Linux Endless: sudo messed up


Dear users,

following problem:
When trying to set my MAC address permanently, I changed the owner of /etc (and all subfolders) to my own account (since otherwise I could not change /etc/network as it was writing protected), not knowing that this might cause troubles for sudo.

Now of course, if I want to use sudo, I get the error message
"no valid sudoers sources found, quitting". Could you please help me restore it?

Two things I've tried, that don't work:
- pkexec ... --> an authorization is required with a password, to run "/bin/bash", however, this password is NOT the one from my account, so I do not know it!
- something like chown root:root /etc/sudoers --> "Operation not permitted"

There are also suggestions to start Linux in recovery mode or s.th. like that - but I do not know how (holding shift at restart doesn't work).

Thanks in advance!
 
Old 03-28-2018, 03:36 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
Well, you have got yourself into a mess! You have at any rate learned an important lesson for the future: never change the ownership or permissions of system files. They are what they are for a reason. If you need to modify configuration files, use sudo to do your edits. That's what it's there for.

Endless is a very atypical Linux. It's designed as a playpen for users who don't know much about computers but just want simple functionality. It is deliberately crippled in many ways, so it's a bad distro to experiment with. In a standard Linux, there would be several ways of getting out of this bind, the simplest being to use su with the root password, but it seems that you weren't given a known root password (as in the *buntus).

If it were Windows, you'd be told "Just reinstall", and of course that would work here too. But a slightly less drastic solution would be to boot from a SystemRescue CD or USB drive (which automatically gives you root access), mount the root partition and chown /etc back to root:root.

You might also want to think of installing a second, more standard system like Debian alongside Endless and doing your experiments there. You learn by this kind of thing, but Endless is not a good system for learning. It wasn't designed for that.
 
Old 03-28-2018, 03:42 AM   #3
Osmium_Dresden
LQ Newbie
 
Registered: Mar 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for the reply, hazel.
Yes, me, as being new to the operating system, thought, "Well, this ACER has a Linux distribution, and Linux is what I want" and didn't know that there are so large differences.

However, I actually found a way to restore it!

1.) Instead of Shift, press "Esc" to get to the GRUB menu.
2.) Then basically follow the instructions from
https://support.endlessm.com/hc/en-u...ot-my-password

at the bottom (case without USB stick) up to the point where the command line should start (points 1-7).

3.) Enter chown .... (whatever should change ownership, in my case chown -R root:root /etc).

Voila, all works perfectly again
 
Old 03-28-2018, 05:36 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
Good! I'm glad you found an answer by yourself. You definitely have the right attitude for a Linux user. Many people here would say, "Play with it until it breaks, then learn how to mend it." But that's easier to do in some Linux distros than others. One of my beefs with the Ubuntu family and the reason I don't use them is that they don't give you a root password, so if you mess up sudo, you've had it.
 
  


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
deny sudo -s/ sudo -i command in linux with /etc/sudoers gbcbooks Linux - Security 35 02-18-2017 10:28 PM
LXer: Endless OS 3: Linux for the Net Less LXer Syndicated Linux News 0 09-30-2016 04:31 AM
Messed up sudo in Ubuntu scandalist Linux - Newbie 7 05-10-2012 05:11 PM
Linux goes into an endless cycle gubak Linux - Server 4 06-25-2010 02:26 AM
Linux Boot stuck in endless loop. gbarcalo Linux - Software 1 12-03-2003 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 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