This method should work just fine especially when it is an administrative user account involved, where there is no other option but to use the recovery mode. Press to continue with normal boot sequence: Confirm Ubuntu Normal Boot Summary Use the Right Arrow to select and hit Enter: Ubuntu Recovery Menu – Resume Normal Boot Last but not least, after running all the necessary commands, type the exit command to go back to the “ Recovery menu”: # exit Supposing that the permission on the /etc/sudoers file is not set to 0440, then run the following command to make it right: # chmod 0440 /etc/sudoers Solving Case #3 – Setting Correct Permission on sudoers File # See sudoers(5) for more information on "#include" directives: # Allow members of group sudo to execute any command # Members of the admin group may gain root privileges # See the man page for details on how to write a sudoers file.ĭefaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbi$ # Please consider adding local content in /etc/sudoers.d/ instead of # This file MUST be edited with the 'visudo' command as root. On the assumption that the /etc/sudoers file was altered to prevent users in the sudo or admin group from elevating their privileges to that of a super user, then make a backup of the sudoers files as follows: # cp /etc/sudoers /etc/inal Solving Case #2 – Granting sudo Privileges to Users Or else, under the condition that a user has been removed from the admin group, run the following command: # adduser username admin Note: Remember to use the actual username on the system, in my case, it is aaronkilik. Ubuntu Mount Filesystem Solving Case #1 – Add User to sudo or admin GroupĪssuming that a user has been removed from the sudo group, to add the user back to the sudo group issue the command below: # adduser username sudo As we had seen before, the filesystem is mounted as read-only, therefore, to make changes to the system we need to remount is as read/write by running the command below: # mount -o rw,remount / Next, press Enter for maintenance: Ubuntu MaintenanceĪt this point, you should be at the root shell prompt. Ubuntu Recovery Menu – Drop to root Shell Prompt Move over to the line “ root Drop to root shell prompt”, then hit Enter. Ubuntu Recovery Modeīelow is the “ Recovery menu”, indicating that the root filesystem is mounted as read-only. You will be at the interface below, select the kernel with the “ recovery mode” option as below and press Enter to advance to the “ Recovery menu”. Using the Down Arrow, select “ Advanced options for Ubuntu” and press Enter. On the other hand, if you are running a dual-boot ( Ubuntu alongside Windows or Mac OS X), then you should see the Grub boot menu by default. If you happen to be running only Ubuntu on your machine, after powering it, press the Shift key for a few seconds to get the Grub boot menu. What if you are denied usage of sudo due to one or more of the reasons we mentioned above.īelow is an image showing a case in which the default system user is being prevented from running the sudo command: ~ $ sudo visudoĪaronkilik is not in the sudoers file. In order to perform crucial tasks on your system such as viewing or altering important system files, or updating the system, you need the sudo command to gain superuser privileges.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |