It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Well I tested that and it didn't work. I had to type the password when I logged in and that part worked, but then I tried to use the password when I mounted a drive (I still don't see why it makes me do it then) and it didn't accept it.

I checked the /etc/sudoers file (it let me open it with read/write permission, which is weird since I didn't even have sudo access!) and the line that I put there was still in place:

abc ALL=(ALL:ALL) ALL

So I know it recorded the change that I made, but that didn't fix the problem. Did I do it right or not?

Please just tell me the exact commands that I need and if they work then I PROMISE that's all I need for this whole project!
Why not simply use the root account and leave it at that?
useradd -m i_should_read_arch_wiki
passwd i_should_read_arch_wiki
EDITOR=nano visudo

add line:
i_should_read_arch_wiki ALL=(ALL) ALL

save, quit and reboot

Check with
sudo -ll
avatar
brouer: Why not simply use the root account and leave it at that?
I have no idea anymore.

Apparently he wants them not to have sudo access and login as a non-root user.

At the same time he will be giving them the sudo password, so that they can do things.

*raises hands*

I mean, not running as root is a good idea for everyone and we all do it. But for this project? I don't know why.
Post edited December 19, 2020 by rojimboo
oh my god is this still not fixed?
linux for those who want adventures to fix their os each week new adventure
dive deep into the forums finding ancient textures of legendary bugs
write divine scripts to keep errors away
avatar
brouer: Why not simply use the root account and leave it at that?
Because when I do that it either won't secure the login, even if I assign a password to the root account, an also, root doesn't have a home directory by default (it makes one when I create a different user), and I need the home directory for other things, like the .local and .config folders so that I can set up things like dconf (for desktop interface settings, some of which are very important) and libreoffice configurations. But if I make the folders manually for root then they work, except for some reason as soon as it boots Cinammon crashes and refuses to reload so it reverts to Mate.
avatar
rojimboo: useradd -m i_should_read_arch_wiki
passwd i_should_read_arch_wiki
EDITOR=nano visudo

add line:
i_should_read_arch_wiki ALL=(ALL) ALL

save, quit and reboot
Alright, first of all, I did check the Arch wiki for the stuff about sudoers, and it said the same thing that I found elsewhere, and when I followed the advice I got the same problem that I posted above, even though I edited the line in the sudoers file to give the permissions. Speaking of which, in your line did you mean for (ALL) to be (ALL:ALL)? Because that's the way it had it in the example.

Is it important that the editor be nano? I think by default it's vi (though it sure looks like nano, though I haven't tried vi in years so I don't remember what it loooks like). In any case, I can edit the file just fine.

And why reboot after editing the file? Remember, I'm in the Cubic terminal, so how would I even reboot the "computer" (a virtual machine?) from there?

avatar
rojimboo: Check with
sudo -ll
Well that's some information that I didn't have before. That might come in handy - thanks.

avatar
brouer: Why not simply use the root account and leave it at that?
avatar
rojimboo: I have no idea anymore.
See the reply that I wrote for brouer, because it explains very specifically why I need root permissions but can't use the root account directly (unless there's a work around of which I'm not aware).

avatar
rojimboo: Apparently he wants them not to have sudo access and login as a non-root user.

At the same time he will be giving them the sudo password, so that they can do things.
Well, more accurately, I want them to have root/sudo access, but couldn't find a way to do so using the root user while still enabling the login password requirement and not causing other weird glitches that happen when I do it that way, for some reason (again, see my reply to brouer).

avatar
rojimboo: I mean, not running as root is a good idea for everyone and we all do it. But for this project? I don't know why.
Well in my normal Linux environment I run as the default user that I set up when I installed it, and set a password for root access, but is that a bad idea? I mean I'm not sudo by default until I use the sudo command, so I didn't think that would be a problem.
I've also tried to disable automatic login following instructions on this page:

https://techpiezo.com/linux/enable-or-disable-automatic-login-in-ubuntu-20-04/

I thought that might make the root require a password to log in (though I don't know it it would fix the glitch of Cinnamon crashing). But when I looked for the /etc/lightdm/lightdm.conf it either wasn't there or didn't have any of the stuff in it which is supposely there (I don't remember exactly what happened but in any case, it wasn't the way the instructions say it should be, so there was nothing I could do with it).
from the arch wiki under sudo:

USER_NAME ALL=(ALL) ALL


i don't know where you got ALL:ALL from or if it works...
I remember seeing it somewher, and it was also the default in the sudoers file, so I just kept following that same syntax.
Either have root as username with its password (check it even works in your live iso after modifying sudoers, there's a chance it doesn't if you didn't edit it with visudo) at login, or do the steps outlined to create a non-root user with its own password. The non-root user will have to put in the root password for root access. It's up to you to keep them separate/same/not use them. I've done this step several times at a fresh Arch install and it's never failed. So not sure what's up. If it still doesn't work, go through all the commands and steps that you did. And try to check users/groups/passwords/sudo priviledges like with sudo -ll etc.

These things should be really simple, but somehow they seem an insurmountable task in this project ;)
Believe me, I realize that (the part at the end about it being insurmountable). I'm going to try it again and see if it works if I do it slightly differently than before. If it doesn't work then I'll post what I did.

EDIT: If you've done it several times, can you please just give me a list of the exact commands to use? I'm desperate here!
Post edited December 19, 2020 by HeresMyAccount
Alright, I did it again, and here's what I did:

usermod -p [password] root
adduser xyz # I assigned the same password to this user as I did to root
usermod -G root xyz # I added the user to the root group
usermod -g 0 xyz # I made the root group the primary group of the user
usermod -u 0 -o xyz # I gave the user the same ID as the root just to be certain that it would be given root privileges!

At this point, id xyz and id root both say:

uid=0(root) gid=0(root) groups=0(root)

Then I did this:

visudo

Then I edited part of it to say:

# User privilege specification
root ALL=(ALL:ALL) ALL
xyz ALL=(ALL:ALL) ALL

I just added the xyz line, because the root one already said that (yes with the ALL:ALL, and that's the same thing that it says on any installation of Linux that I have, so I dont' see how it could be wrong).

Then when I booted it automatically logged in as root rather than having me manually log in as xyz! It didn't crash Cinnamon this time, but that's probably because this time I didn't alter the files for the "root" user, since I thought I'd be logging in as the other user instead. I checked the menu -> Login Window, on the Users tab, and "Allow manual login*", "Hide the user list*" and "Allow guest sessions*" are all unchecked, and "Username*" is mint (why doesn't it say root?).

It also had some other stuff wrong, like it didn't configure some of the things that I had set, but I think that's probably just because I copied in the preference files for xyz rather than root (since I thought I'd be using xyz). I still haven't been able to test screenshots or verify that the firewall is properly configured, though I hope they would be, as long as I'm logged in properly.

In any case, I'd REALLY like to get this done today!
I tried it again almost exactly the same way as the post just before this one, except that I didn't change the user ID of xyz to match that of root (0). The effect was that this time I could log in securely as xyz, and nothing crashed or glitched, except that I still couldn't get root/sudo access to do anything, including mouting the hard drive!

No matter what I do, I can either access everything as root but without logging in, and if I customize anything in the interface then it causes Cinnamon to crash, or otherwise I can log in securely without any crashes/glitches, except that I then can't authenticate anything with my password so nothing works.

At this point, don't you think the easiest thing for everyone would be if you just tell me the exact list of commands to put into Cubic? Then I'll do that and it should theoretically work!

EDIT: I almost forgot, I tried sudo -ll, but of course I couldn't copy and save the text because I couldn't mount any drives, but it said a ton of stuff about ALL access to this and that. In any case, I remember that one line near the beginning said something like:

Permissions for xyz to access various stuff for mint:

I don't remember the exact wording, but it did say "mint" with a lowercase m, which is weird, except that "mint" is the directory that the root user is given within the home folder (I still don't know why it's not called root, or otherwise why the root user isn't called mint, but the names don't match). Anyway, it seems weird, because that's a different user than xyz, as whom I was logged in. But then after that line there was a blank line of white space before the rest of the stuff. I don't know if that's intended to offset it like a heading, or if it's implying that there are NO permissions for that user, and everything else is separate from that.

EDIT: Actually, I compared the line to what I get in my HD installation, and it had actually said:

User xyz may run the following commands on mint:

And even on the HD installation there's a blank line after it, so I guess it's supposed to be like that. Actually, looking at this one, it's very similar to the other one (I recognize a lot of the same things), so that may not be the problem after all.

And by the way, what causes it to make me log in as a different user than root, simply because another user exists? I don't know that I trust that, because I don't understand how or why it changes the default.
Post edited December 19, 2020 by HeresMyAccount
avatar
HeresMyAccount: EDIT: If you've done it several times, can you please just give me a list of the exact commands to use? I'm desperate here!
Like I said, this is what I simply do (from a clean install with nothing setup yet):

useradd -m i_should_read_arch_wiki
passwd i_should_read_arch_wiki
EDITOR=nano visudo

add line:
i_should_read_arch_wiki ALL=(ALL) ALL

save, quit

Check with
sudo -ll

and other user/group/password related commands. A simple 'su' to change to root to check root password and access, in case sudoers got messed up, if needed, is worthwhile.

I have no idea what you're doing with your 20 commands and why. It seems like you're making the non-root user as close as possible to a root user, which seems to defeat the whole purpose of a non-root user. The 'useradd -m' simply and robustly creates a user in its own user group for its own home directory. Not sure why you want the home directory group to be root, yet for the non-root user. Seems like a mess to be honest.

The display manager (at login, probably gdm for mint cinnamon) should pick up the available users or default to root if it can't find any, and use their passwords. If not, seek out the display manager's instructions to manually add login options.. Like I said, I doubt you need this step at all, it's always been automatic for me and gives the option for multiple desktop environments across all users (well, root and non-root user, so two options).
You really seem to have misunderstood a lot of what I've said so PLEASE READ THIS CAREFULLY, just because it will clear up a LOT of confusion:



Alright, first of all I did read the Arch wiki and it didn't solve the problem, and sudo -ll seems to look perfectly normal (compared to how it looks on my installed version of Mint) and implies that I have pretty much all permissions for everything, yet it still doesn't work.

And you're talking about an installed version, but have you ever tried all that in live mode on a custom ISO made in Cubic? Because I've tried it just like you said and it doesn't work!

And you're misunderstanding a few things:

I've tried basically two separate kinds of methods:
- Using the root user for everything
- Making a new user to use instead and trying to give it root permission

I don't set up stuff in the home directory for root when I'm using the other user - I just set it up in the home directory for whichever user I'm using.



The method for just the root user works fine except that:
- When I customize the user interface at all (which is absolutely essential for some things I need to do) by copying in a dconf/user file that I created in an installed version of linux, it causes Cinnamon to crash during startup and become unrecoverable, thus reverting to Mate (I could try the whole thing just with Mate instead, but I've had more pressing issues).
- No matter how I assign a password it doesn't work! It keeps logging in automatically no matter what I do!

The display manager that I'm using is actually lightdm and I've looked into that and messed with it a bunch. The thing is, there's a file called /etc/lightdm/lightdm.conf which holds the settings, and this file exists in my installed Linux on my HD but it does NOT exist within Cubic! So I had to create the file, and put this into it:

[Seat:*]
#autologin-guest=false
#autologin-user=root
#autologin-user-timeout=0

This is following these instructions:

https://techpiezo.com/linux/enable-or-disable-automatic-login-in-ubuntu-20-04/

But when I do that, then once I make the ISO and boot it, I look in that file and it says:

[Seat:*]
#autologin-guest=false
#autologin-user=root
#autologin-user-timeout=0
[SeatDefaults]
allow-guest=false
autologin-guest=false
autologin-user=mint
autologin-user-timeout=0

As you can see, it just appends stuff to override what's already there! I'm going to try putting this into it instead:

[SeatDefaults]
allow-guest=false
autologin-guest=false
autologin-user=
autologin-user-timeout=0

My thinking is that it won't be able to override stuff that specifically tells it NOT to allow autologin, rather than just comments that do nothing (I read somewhere that if I set the user to nothing that prevents it).

I've even been on the Cubic message board and was told to do this:

https://answers.launchpad.net/cubic/+question/692073

I tried it (with the exception that I swapped gdm3 for lightdm and I had to make a new file for it) and it didn't work, but like I said, next I'll try the file with the text printed just above.



As for the other method, to add a new user, by the way I'm using adduser rather than useradd (supposedly it's more compatible with Debian distributions).

In this method, it does NOT automatically log in (and Cinnamon doesn't crash), but it has the opposite problem: I can't seem to get the user to have root/sudo access and whenever I type a password it says it's invalid (which it even requires me to do for mounting and ejecting drives, even though it NEVER requires a password for that on my HD installation, and for some reason, no matter how many times I inquire about that particular issue it always falls on deaf ears - do people have some weird mind-control in their brain that prevents them from seeing that bit of text?).

You say I should change to su to check the password, but I CAN'T change to su, and that's the whole problem!

I've tried to put this user in the root group like so:

usermod -G root xyz
usermod -g 0 xyz

And I even gave the user the same password as the root user just in case that matters, but it still doesn't grant me root/sudo access. I've also tried sometimes setting the user ID to match the root (0) but that just causes the login to get confused and autologin the root instead (so it becomes like the other method).

In this method, no matter what I do, it just won't allow the extra user to have root/sudo access, even though the password works fine (it requires it for logging in, like it's supposed to).

On Cubic's website I was pointed to this page:

https://answers.launchpad.net/cubic/+question/681179

It talks all about preseeding, which as far as I can tell has to do with setting default options for an installer, but I'm not sure how that's relevant to what I'm doing, since I only want a live mode which can't even be installed (I'm uninstalling Ubiquity). But there's a section about users (search the page for "# User") which supposedly may be helpful, but I haven't gotten around to trying it yet because I'm still messing with the other method (for the root user), and I really have no idea how to implement reseeding, so that'll be interesting to try and figure out.



In any case, you can see that it's a catch-22, because one method makes it log in automatically and do everything without requiring a password at all, which I don't want (at least I want to use a password for logging in), and the other method is the other extreme, so that I can't use the password to do anything except log in!

Do you understand the dilemma now?