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.

Possible Duplicate:
How do I grant sudo privileges to an existing user?

I've been searching for the answer to this but all I find is "It's not a good idea" or "We don't recommend it" and some work around solution is given...

I am a new, yes. There is a good chance I could break stuff, I know. I am happy to break my OS and format it many times if it comes to that but restrictions of ANY kind on my OS enrage me. I want to be able to break stuff if I want, then learn how I broke it and how to fix it.

I want the safety locks off.

Please tell me how to grant a user absolute authorisation.

share|improve this question

marked as duplicate by hhlp, Jorge Castro, Marco Ceppi Jan 22 '13 at 19:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

7  
I wish you happy reinstalling :) and don't blame Ubuntu afterwards. Enjoy. –  don.joey Jan 22 '13 at 14:44
2  
Thanks :) and I won't. I'll learn from my mistakes, the way it should be. –  Ichimitch Hamono Jan 22 '13 at 14:55
1  
The thing is: you are able to break stuff if you want to in the "normal" way with sudo, you just aren't able to do it accidentally. If you have the root password then this is not a restriction in any way, only a well-designed safety speed-bump. Get used to it, it won't cost you much time now but it may save you lots of time in the future when some dangerous operation you didn't really mean to execute was denied. Or when you're working on a system where you don't have the su password, and want to do something easy but you've only learned a way to do it that unnecessarily requires sudo. –  leftaroundabout Jan 22 '13 at 18:25
    
4  
@IchimitchHamono: privilege separation is not just a way to enhance security, but also a software design philosophy. If you want to learn how the software you use work, you should first understand their design principles. With this I'm not saying that your question is non-sense (in fact it is perfectly legitimate), just that if this is a way for you to learn, then you are using the wrong approach. –  Andrea Corbellini Jan 22 '13 at 19:54
show 1 more comment

6 Answers 6

To give the user "foo" unlimited passwordless access to root privileges via the sudo command, edit /etc/sudoers and add the line:

foo   ALL = NOPASSWD: ALL

See sudo(8) and sudoers(5) for more information.

As was suggested elsewhere, if you know how to use vi then it's a good idea to use visudo to edit /etc/sudoers.

share|improve this answer
    
jdthood gave you an excelent tip. read this short article to find out more about the /etc/sudoers tricks :D. linuxg.net/understanding-etcsudoers-file –  fromnaboo Jan 22 '13 at 14:47
add comment

It is not you who is being restricted (as long as you can sudo or login as root on the command-line), but it is rather every single application you run that is being restricted.

If you give yourself root privileges, every application you run also gains complete power over your computer. That is the restriction, and saying you don't want any restrictions placed over you is like saying you do not want to lock your bike or your door, for it places a restriction upon yourself.

I am amazed no one as of yet has tried to offer you that insight.

share|improve this answer
3  
This is exactly what I was trying to go for with my comment on another answer. The reason for the restriction by the Ubuntu devs is not because they think all users are inept; if that were the case, sudo would be disabled too. It's about giving the user the power to selectively give applications more privileges... and keeping the "bad ones" (be they buggy or malicious) from messing everything up à la Windows XP. –  Reid Jan 22 '13 at 18:05
3  
@IchimitchHamono You have root access? Sudo access? You have unrestricted access then. If that isn't what you EXPECT it to be, that's your lack of understanding and inability to learn. I bet money, that just like Android/iOS, you'll have to "Root" or "Jailbreak" before you'll get unfettered access on a Steam Box - Linux OR Windows. If typing "sudo", or learning how to edit /etc/sudoers, is too much restriction for you... You won't enjoy your future. Don't like it? Build your own OS - or find a Distro that doesn't have Sudo (or similar) installed. –  WernerCD Jan 22 '13 at 18:40
1  
@IchimitchHamono: by your own admission, you are new to this. That's completely fine. I even think your question is valid, and interesting. However, your sheer disinterest in finding out why it's not a good idea to actually do this, finding out why you only find posts saying "we don't recommend" it, astonishes me. –  ilias Jan 22 '13 at 18:50
    
There's no need to be offended. I do understand what you're saying, and why you're saying it - security often gets in the way of user experience. All I'm saying is that you should understand the implications of your actions - essentially removing any and all restrictions imposed on each and every application or script you knowingly or unknowingly execute. If you do, and you're fine with running around in the woods, naked and covered in honey; without any means of defence, go ahead and enjoy. It's an interesting exercise. –  ilias Jan 22 '13 at 19:10
2  
Linux, and by extension, UNIX, was designed from the get-go as a multi-user operating system, fit for use in networks. Restricting user access is a logical implication of that design. As such, it is deeply embedded in the whole OS and applications that use it. Out of interest, what did you end up doing? Somehow allowing root to log in in a graphical environment? –  ilias Jan 22 '13 at 19:35
show 2 more comments

Being a noob, you should better use visudo instead of editting /etc/sudoers on your own, at least because:

  1. It checks that no one is using the /etc/sudoers file at the same time.
  2. When you have finished, it checks the file for making sure it's fine.
share|improve this answer
add comment

Wouldn't it be better to add the user to the correct group?

sudo usermod -a -G sudo hduser

see also this duplicate question: How do I grant sudo privileges to an existing user in 12.04?

share|improve this answer
    
This allows hduser to sudo. hduser will of course have to enter a password when using sudo. –  jdthood Jan 22 '13 at 18:45
add comment

ok, this comes from my hacker days of trying everything in the system to see what it did.

There is a file /etc/passwd that famously holds passwords (or a marker to signify shadow passwords).

In that file, you will see something like this:

root:!:0:0::/:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys: 
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp: 
guest:!:100:100::/home/guest:
nobody:!:4294967294:4294967294::/:
lpd:!:9:4294967294::/:
lp:*:11:11::/var/spool/lp:/bin/false 
invscout:*:200:1::/var/adm/invscout:/usr/bin/ksh
nuucp:*:6:5:uucp login user:/var/spool/uucppublic:/usr/sbin/uucp/uucico
paul:!:201:1::/home/paul:/usr/bin/ksh
jdoe:*:202:1:John Doe:/home/jdoe:/usr/bin/ksh 

[example taken from here]

the two sections that are interest to us are the numbers in position 3 and 4. the first one is the user ID, the second is the group. Notice that in this installation (and most installations) the values for root are both 0

If you use su or sudo to edit this file, and change the numbers on your user ID to be the same as root, then you will become root. (also, you will not be able to use rmuser on your ID, as it is now considered essential to the system)

share|improve this answer
    
add another user and change that one to :0:0: - that way, you can choose to log in as root depending on which name you use on login –  Sean Cheshire Jan 22 '13 at 18:02
3  
@IchimitchHamono: You have the power to 'fully access your system' with the default install. It's just that this power requires you to use the appropriate commands, namely sudo and the like, and enter your password when doing so. The existing setup, and the conventional wisdom of trying to keep things out of root, are there for very good reasons, one of which keeping buggy/malicious software from borking your system without your consent. –  Reid Jan 22 '13 at 18:02
    
@Reid, +1 - the windows way of allowing access to everything is not a secure route, but getting used to the way *nix works is quite an adventure (I've still not made the change... too much game play) –  Sean Cheshire Jan 22 '13 at 18:09
1  
if something requires root, and you are annoyed at having to type in that command again, sudo !! is your friend, and UAC is microsoft's attempt to be more *nix like - same as the prompt for passwords. –  Sean Cheshire Jan 22 '13 at 18:15
3  
Changing the uid and gid of a user name to 0 and 0 is very likely to lead to problems down the road. –  jdthood Jan 22 '13 at 18:42
add comment

For anyone also wanting to liberate their system, this is the solution that worked for me:

  1. load the Terminal
  2. type: sudo passwd root
  3. input your user's password when prompted
  4. create UNIX password when prompted
  5. type: sudo sh -c 'echo "greeter-show-manual-login=true" >> /etc/lightdm/lightdm.conf'
  6. reboot the system
  7. at the login screen there is now an option to login manually. login with username 'root' and the password you created at step 4
share|improve this answer
2  
Will Chrome run at all when you do this? –  Bobson Jan 22 '13 at 20:25
    
No. I had to keep the other user account open for normal usage –  Ichimitch Hamono Jan 23 '13 at 3:14
    
Then how is this answer any better than sudo? –  Bobson Jan 23 '13 at 14:10
    
Yep, you can enable the root account and use that, although that isn't a solution to the original problem. I didn't know that Chrome would refuse to run as root, but now I do. :) –  jdthood Jan 23 '13 at 15:56
add comment

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