2
I just installed my first Linux desktop (64-bit Ubuntu 12.04) and am playing around with it:
myUser@myMachine:~$ cd /opt/
myUser@myMachine:/opt$ mkdir lemmiwinks
mkdir: cannot create directory `lemmiwinks': Permission denied
myUser@myMachine:/opt$
This works if I first try to sudo
as root:
myUser@myMachine:/opt$ sudo mkdir lemmiwinks
[sudo] password for myUser:
myUser@myMachine:/opt$ ls
lemmiwinks
myUser@myMachine:/opt$
What's going on here? Why do I have to sudo
to gain access to /opt
(or any other non-/home/myUser
directories?
How do I create and give permissions to new users that can access /opt
? Can I do this for myUser
as well? Thanks in advance!
Thanks @sdjuan (+1) - awesome, awesome answer. Can you please see my comment underneath AthomSteve's answer? I have the same question for you! Thanks again! – pnongrata – 2013-04-14T11:12:37.697
@pnongrata an example is writing to /opt with permissions set as described above, needs elevated permissions which you can get by doing sudo to use the super user permissions to do that task. When you sudo you then are able to use root permissions. One thing to try is do whoami when logged in as your normal user and then do a sudo whoami to see who you become with the sudo. I hope that helps. – sdjuan – 2013-04-15T04:48:06.240