Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to login as root, but when I enter

sudo -s

and enter password, this message is shown: "you are not in sudoers file", and when I enter

su

and enter password, this is shown: "authentication failure".

My os has one account only. about past1 hours ago I log on as root and do some commands , when I logout , I can't login another time!

share|improve this question
    
We'd need to know what commands you ran when you were root. You might need to reset your password: askubuntu.com/questions/24006/… –  Jorge Castro Dec 31 '11 at 21:47
    
Do you want to change user in terminal as you used su command? if you want to then you need to have the root password –  Jatttt Mar 5 at 14:45
add comment

4 Answers

up vote 8 down vote accepted

The su command requires you to put in root password. Root user on Ubuntu in general is locked so no user can login as root thus su is not likely to work.

For sudo -s to work you will have to be part of the admin group on an Ubuntu machine, which apparently you are not.

If you are the only user on the system that is concerning and may be quite involved to fix. If not I would suggest you talk to the System Administrator or owner of the system to see if you even can get root privileges.

share|improve this answer
3  
and if it is your machine, and you've somehow lost root privileges, you'll have to fix it by booting into recovery mode. –  ams Dec 30 '11 at 20:19
    
My os has one account only. about past1 hours ago I log on as root and do some commands , when I logout , I can't login another time! –  ava Dec 30 '11 at 20:28
    
What commands did you do? –  Karlson Dec 30 '11 at 20:29
    
I don't know exactly. that was some simple commands such as changing umask –  ava Dec 30 '11 at 20:32
    
and some shell programming, add group –  ava Dec 30 '11 at 20:35
show 7 more comments

Be aware that the root account is not active by default.

You will need to do:

sudo passwd root

Then go ahead to set password. Use the root user using

su root
share|improve this answer
add comment

The https://help.ubuntu.com/community/RootSudo is suggesting:

If you really need a persistent Root login, the best alternative is to simulate a Root login shell using the following command...

sudo -i

share|improve this answer
    
doesn't work . My os has only one account –  ava Dec 30 '11 at 20:29
add comment

First of all you need to have admin privileges. If you dont have admin privileges then while booting press and hold the shift key. You will enter the grub menu. here select the recovery mode. When you see the list of command like dpkj etc. select the root command and type:

adduser username sudo

[change username with your username :-) ]

this will add you to the sudoers group! Then type exit and boot normally. when you enter your account, type:

sudo passwd root

Then enter your password and type the new root password

After that you can type su and enter the 'root' password.

If you dont want to change the root password then you can use:

sudo -i

And vola! You Are Root In Terminal:)

share|improve this answer
    
Tell me if you want to activate the root account to log in the root account :) –  Jatttt Mar 5 at 14:57
add comment

protected by Community Mar 24 at 9:40

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.