Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 14755  / 1 Year ago, sat, december 17, 2022, 12:40:58

I have accidentally changed the root user from administrator type to basic type in the user account page, and now i have no whatever root previligaes on the system, how i can switch back to administrator type?


More From » root

 Answers
2

Assuming you have not actually changed the root user but removed the first user from the list of administers then this is relatively easy to fix.



Press CTRL+ALT+T and enter id



You should see something similar to.



~$ id
uid=1000(warren) gid=1000(warren)groups=1000(warren),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)


If this shows sudo you should be an administrator. In Ubuntu prior to 12.04 the group was admin If not this is the problem.






First you need to boot to a root shell if you don't normally see grub when you boot hold SHIFT.



You should see something like this:



grub



Select recovery mode, then drop to root shell.



grub2



Finally mount the file system read write



mount -o rw,remount /


If the problem was that you were not in the sudo group it can be fixed with



usermod -aG sudo warren


replacing warren with your user name. If you are not sure what the user name should be it was the uid= field from the id command you ran earlier.



replace sudo with admin if you are using a version of Ubuntu prior to 12.04.






Another less likely possibility is that you have changed the sudoers file



If this is the problem then enter



visudo


Edit this file to look like this (12.04 default):



#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

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

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

[#31847] Saturday, December 17, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
icielight

Total Points: 158
Total Questions: 92
Total Answers: 93

Location: San Marino
Member since Thu, Jun 30, 2022
2 Years ago
icielight questions
;