Er... I tried the step written in
When I select "Drop to root shell prompt", it asked my root password.
As by default Ubuntu lock root user, it asked:
"Give root password for maintenance"
any other solution?
Thanks
sulogin is patched in Ubuntu, if the root account password is locked, then you are not prompted for a password in Recovery Mode.
So, you probably have enabled the root account.
To lock the root account password or set up a new password:
boot the computer
at the grub menu highlight the Recovery Mode option
press e for edit
highlight the kernel line and hit e for edit
delete ro single from the end of the line and replace it with rw init=/bin/bash
hit Enter, then b to boot
in the shell make sure that the root partition is mounted rw:
mount -o remount,rw /
lock the password (or change it):
passwd -l root
to change the password (not recommended):
passwd root
reboot the computer: press Ctrl+Alt+Del
Now you can boot in Recovery Mode and resolve the sudo problem.
make sure that the hostname is the same in both /etc/hostname and /etc/hosts
Sorry, user is not allowed to execute '/bin/bash' as root on B
edit the sudoers file:
visudo
and allow your user to use sudo. add something like:
username ALL=(ALL) ALL
username = the user name :)
ALL = from any Host/IP
(ALL) = can run as any user
ALL = all commands.
your line in the sudoers file probably looks like this:
username oldhostname=(ALL) ALL
so, you have to change it to:
username newhostname=(ALL) ALL
HowTO: Sudoers Configuration
阅读(2764) | 评论(0) | 转发(0) |