LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   UBUNTU 7.04 i386 cannot login as root ... ? HELP ? (https://www.linuxquestions.org/questions/linux-newbie-8/ubuntu-7-04-i386-cannot-login-as-root-help-596601/)

shaft 11-02-2007 09:10 AM

UBUNTU 7.04 i386 cannot login as root ... ? HELP ?
 
Hi there! I have installed ubuntu 7.04 and I'm trying, to change root password, but there is some troubles...

This is what i try :

Code:

killersoft@KillerSoft-desktop:~$ sudo passwd root
sudo: /etc/sudoers is mode 0777, should be 0440

After that i try
Code:

killersoft@KillerSoft-desktop:~$ sudo chmod 0440 /etc/sudoers
sudo: /etc/sudoers is mode 0777, should be 0440
killersoft@KillerSoft-desktop:~$

killersoft@KillerSoft-desktop:~$ chmod 440 /etc/sudoers
chmod: changing permissions of `/etc/sudoers': Operation not permitted
killersoft@KillerSoft-desktop:~$

killersoft@KillerSoft-desktop:~$ chown root:root /etc/sudoers
chown: changing ownership of `/etc/sudoers': Operation not permitted

killersoft@KillerSoft-desktop:~$ sudo chmod -R 440 /etc
sudo: /etc/sudoers is mode 0777, should be 0440

killersoft@KillerSoft-desktop:~$ passwd root
passwd: You may not view or modify password information for root

After this i still getting this row
Code:

sudo: /etc/sudoers is mode 0777, should be 0440
How can I login as root? I am newbie ubuntu user :)

duryodhan 11-02-2007 09:44 AM

Ubuntu doesn't allow you to login as root, for safety and for noobs.

if you are noob, then use only a normal user, and sudo if required. There is a reason why they did that.

wit_273 11-02-2007 11:10 AM

Not sure how/why your /etc/sudoers got set to 0777, that is not what you want--0440 is the correct permissions. Looks like with the incorrect settings it is not even allowing you to use the sudo command. You might want to try logging in with single user mode. You can do this by hitting ESC during boot to get the GRUB menu. Hit 'e' to edit GRUB, then choose the line that begins with kernel and hit 'e' again to edit that line. At the end of the line type in 'single' (without the quote marks). Hit enter, hit 'b' to boot. This will boot you into and terminal session as root without asking for a password. From here do the following

Code:

chmod 440 /etc/sudoers
You can also set roots password here by typing
Code:

#passwd
And entering what you want for the root passwd.

Once you have reset the permission on /etc/sudoers and done what else you need to do from this session all you need to to is reboot to revert back to your normal login.

I would follow duryodhan advice though and not setup a root password, but use sudo instead. If you have several commands you need to run as root and do not want to have to type sudo before each one just do one of the following.

Code:

sudo su
or
Code:

sudo -i
Hope this helps.


All times are GMT -5. The time now is 01:38 PM.