2

I want to reinstall Linux Mint.....

Many commands start with sudo and then apt-get or whatever. I am never able to get past this. Typical attempt:

john@john-AY022AA-ABA-p6330f:~$ sudo apt-get install sqlitebrowser
[sudo] password for john: 
Sorry, user john is not allowed to execute '/usr/bin/apt-get install sqlitebrowser' as root on john-AY022AA-ABA-p6330f.
john@john-AY022AA-ABA-p6330f:~$ 

and

john@john-AY022AA-ABA-p6330f:~$ cd /etc/sudoers.d
john@john-AY022AA-ABA-p6330f:/etc/sudoers.d$ ls -l
total 8
-r--r----- 1 root root 180 Mar 22  2017 mintupdate
-r--r----- 1 root root 958 Jan 17  2018 README

and

passwd file [copy and paste from vim]

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin

I seem to have successfully changed the password by escaping into the Grub menu. I can get past the screen saver. I want to wake up the arduino IDE. It worked fine for months, but died. All paths are stopped by the dead end at sudo. I suspect that I need to reload the Linux. I want to reinstall Linux Mint!

closed as unclear what you're asking by DarkHeart, jimmij, Michael Homer, Kusalananda, roaima Feb 19 at 7:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Do you get a chance to enter your password? Is it set up with rootpw? Do you get any messages back? – Jeff Schaller Feb 18 at 22:36
  • 4
    If you want an answer, you need to at LEAST tell what the error message is. "but the sudo stops me" tells us nothing. Given you're talking about the permissions table, I'd also suggest including the output of ls -l /etc/sudoers /etc/sudoers.d, including any errors it may report. You can update your question to include this by using the 'edit' link between the 'share' and 'flag' links right under the tags on this page. Thank you. – Ed Grimm Feb 18 at 23:35
  • 1
    As an alternative to sudo, you should know your root password, and can just login as root to do what you want (including fixing your sudoers file & group permissions for who's allowed to sudo). – michael Feb 18 at 23:56
  • Per michael's comment, are you able to log in as root? – Jeff Schaller Feb 20 at 1:19
  • 1
    @G-Man: The system might be connected to some form of centralized password database, like Active Directory or some other form of LDAP directory, or a NIS server. If that's true, there should be people in John's local organization who should be able to help. – telcoM Feb 20 at 8:12
2

It will be difficult to figure out exactly what you've done to your computer because you don't have the permissions to find out. I'm less familiar with Mint, but its a fork of Ubuntu and Debian so I guess it is based on the same group settings.

Basically there's a user group you should have been added to by default. Either adm, admin or sudo. You sudoers file (/etc/sudoers) should have an entry to let anyone in that group use any command.

Almost certainly one of these two things has broken. The problem is that if this is broken you can't recover from inside your own opperating system. You have locked the keys in the safe.

Possibly your easiest fix will be to install linux on a USB drive or a CD, boot that up, then edit your /etc/sudoers and / or /etc/group manually.

To create a bootable USB drive, I know that the ubuntu installer has an option to "try ubuntu" without installing it. I wonder if mint has the same option.

-1

You can boot with a Mint CD/DVD. Don't install and select command line. (Not a Mint/Unbutu guy, can't tell you exactly how to do this.) Then, you can mount your hard disk under /mnt and see your drive. You will be root when you do this, so take the opportunity to the sudoers steps that @Philip mentioned.

=> Not recommended, but still a possibility when booting from CD <=
You can also disconnect this machine from the internet and remove the password in /etc/shadow or /etc/passwd.
If you have an /etc/shadow file, remove all the characters between the first & second colon.
If you don't have /etc/shadow, do follow the same steps as above, on in the /etc/passwd file.
This will remove the root password. You can then try to log in as root with no password. Do what you need to do, reset the root password and re-connect to the internet.

  • wouldn’t erasing the passphrase be a nologin situation in this universe? how’s about passwd for the live user, and adding that to shadow? tell me more – user2497 Feb 22 at 20:35
  • root is ALWAYS a local account. It's password can be stored in either /etc/shadow (preferred) or /etc/passwd. To tell the difference: grep root /etc/passwd you should see: root:[password indicator]:0:0:[other stuff] [password indicator will be x if the password is in /etc/shadow, hash if it is in /etc/password, or !! if you cannot login as root. If it is not an x, remove the [password indicator] for /etc/password. if it is an x, remove the second colum from /etc/shadow. i.e. root::[other stuff] – Scottie H Feb 25 at 18:55
  • 1
    Now, about passphrase: if the password is !!, you cannot log in as root, you can only sudo or ssh_keys. If the password field is empty, then you can log in as root and simple press enter for the password. Does that answer your question? – Scottie H Feb 25 at 18:57
  • You also need to be sure that AllowRootLogin is not set to no in /etc/ssh/sshd_config to log in as root. – Scottie H Feb 25 at 18:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.