Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103377
  • 博文数量: 19
  • 博客积分: 1550
  • 博客等级: 上尉
  • 技术积分: 246
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-15 19:50
文章分类

全部博文(19)

文章存档

2013年(1)

2012年(4)

2010年(8)

2009年(6)

我的朋友

分类: LINUX

2013-03-13 20:28:05

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) |
0

上一篇:多线程javamail下载gmail附件

下一篇:没有了

给主人留下些什么吧!~~