Change super-user, how?

Archived topics about LMDE 1 and LMDE 2
Locked
yonnie
Level 3
Level 3
Posts: 128
Joined: Mon Jan 03, 2011 12:18 am

Change super-user, how?

Post by yonnie »

I take older computers and install LM onto them and then give them to neighbors, grandkids and friends. I would like to find an easy way to remove the present administrator and put on the new owner. Presently I build the system for the owner which is impractical for a flea-market environ.

The only way to do this I've found so far is to re-install the whole system which is a real PITA! Is there a quick easy method for this?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
We are children of children and do as we are shown.
-James Curran
User avatar
karlchen
Level 23
Level 23
Posts: 18211
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Change super-user, how?

Post by karlchen »

Hello, yonnie.

There is no need to re-install Linux Mint in order to establish a new user account who replaces the old administrator user.
Logged in as the old administrator user create a new user account.
Make sure the new user is a member of the following user groups:

Code: Select all

$ grep newadmin /etc/group
adm:x:4:newadmin
cdrom:x:24:newadmin
sudo:x:27:newadmin
dip:x:30:newadmin
plugdev:x:46:newadmin
lpadmin:x:109:newadmin
sambashare:x:127:newadmin
Note:
The two group membershipts that make the new admin user an admin user are the memberships in the groups "sudo" and "adm".

Once the new account has been created and configured (see above), login as the new admin user.
Make sure you can perform all administrative tasks successfully.
Make sure you can use the "sudo" command successfully and execute things with root privileges.

Once this is the case and no sooner (!!!), remove the previous admin account or simply take away his membership in the groups "adm" and "sudo" thus degrading him to a normal user account.

Kind regards, and a happy new year,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
yonnie
Level 3
Level 3
Posts: 128
Joined: Mon Jan 03, 2011 12:18 am

Re: Change super-user, how?

Post by yonnie »

Hey thanks and Happy New Year to you too!

Not sure if it makes much difference but there is no /etc/group folder on this machine. The rest of the stuff you mention does make sense and is an angle I haven't tried yet, a lot to remember, I'll need to make a list! The problem I was having seemed to mostly orient around owner id which was 1000?, and root was 0? I forget as this was several days ago. I tried making a new user, giving the new user admin powers, but could not get rid of having to use the original password for admin purposes. Kept having the change password prompting with an error message everytime I tried to change it to be the same as the new user. And after I deleted the original user, I could not then alter that password, even though the new user had SU powers.
We are children of children and do as we are shown.
-James Curran
User avatar
karlchen
Level 23
Level 23
Posts: 18211
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Change super-user, how?

Post by karlchen »

Hello, yonnie.
Not sure if it makes much difference but there is no /etc/group folder on this machine.
/etc/group is a file, not a folder.
You can verify it is by executing

Code: Select all

cat /etc/group
The user root will and must always have the user Id 0. Correct.
The first user created during the installation will always have the user ID 1000. Correct.
The next user will be assigned the user ID 1001 and so on.
Users which are system users will be assigned IDs clearly below 1000. This is by design.

Changing the root password:
  • Login using your new account name. Hopefully he really is a member of the groups "sudo" and "adm".
  • Open a terminal session.
  • Make this a root session by executing

    Code: Select all

    sudo -i
    Type in your user password when prompted.
  • Execute

    Code: Select all

    passwd
    Type in the old root password. Type in the new root password. Type in the new root password. This should be all.
  • Exceute

    Code: Select all

    exit
    to terminate the root session.
  • Exceute

    Code: Select all

    exit
    again to terminate the terminal session.
Kind regards,
Karl
Last edited by karlchen on Thu Jan 10, 2013 10:34 am, edited 1 time in total.
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
yonnie
Level 3
Level 3
Posts: 128
Joined: Mon Jan 03, 2011 12:18 am

Re: Change super-user, how?

Post by yonnie »

Karlchen, thanks for the help and sorry about the delay in getting back to this.

Your commands work just fine, except they don't ditch the old guy and put in the new guy. They just change the password of the old guy. Also, when making a new administrator, in the users and groups gui, the new guy is still user id 1001 even though he has been given admin powers and the old guys password is still required. Reboot does not change this. The old guy has been given a new password, which should effectively lock him out, but any changes requiring admin powers still asks for old-guys password by name.

The old-guy got fired, the staff would like to forget about him, how can I make it like he was never here?

Also, another issue with changing password/user. When trying to log-in to package manager as new-user with admin powers, the new-guy password failed, the old-guy password failed and the old-guy old password failed.
We are children of children and do as we are shown.
-James Curran
User avatar
karlchen
Level 23
Level 23
Posts: 18211
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Change super-user, how?

Post by karlchen »

Hello, yonnie.

Now things are getting tricky, provided this is a company machine, because you cannot be expected to post files like /etc/passwd, /etc/group and /etc/sudoers publically in such a case. Yet, these files would be the first files which I would inspect in order to find inconsistencies. Actually I would have a peek at /etc/shadow as well (you need root privileges to do so).

By the way, the ID 1001 is perfectly all right. The first user on a system, except the system users, will have the ID 1000, the second user has got the ID 1001, the third user 1002 and so on.
The user ID itself does not make a user an admin user or prevent him from being an admin user. It is the membership in the relevant groups, sudo, adm, which grants the right ot act as root user temporarily.
This privilege can be granted to more than a single user on a given system.
Granting a user the privilege to act as root does not change his/her user ID. If you have manually tinkered with the user ID this will be the point where things started to go wrong.

If this is a company machine, the best thing which you can do may be finding a local Unix/Linux expert whom you can trust and have him investigate the problem.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Locked

Return to “LMDE Archive”