You do not own the files, neither do you have the permission to write to /usr/share/tomcat6/webapps
. The following command will change the ownership of the webapps folder and files recursively to yourusername
. That enables user yourusername
to write to that directory.
sudo chown -R yourusername /usr/share/tomcat6/webapps
You're not the root user; you are a user which has the privilege to become root, using the sudo
(or various graphical surrogates) method.
In Ubuntu (and in most not-embedded Unix environment) you normally work, and have the privileges, of a normal user. Only deliberately you can override the normal rules; it is a way of telling you that you have to know what you are doing. It is a great safety net that works normally quite well(1).
For example, although it can have legitimate uses, trying to add manually a file to /usr/bin
is normally wrong.
You can find all the info you need here: https://help.ubuntu.com/community/RootSudo
(1) although remember that Unix, in general, gives you rope(2) if you really want to hang yourself.
(2) You can run the file manager application as root
, as explained in the other answer.
Alas, you shouldn't.
This is the rope I mentioned in (1). A wrong click, a spurious double click, and you can have a completely messed up system, to the point of having to reinstall it. I am a power user, and I have to use root powers maybe... once a week? And most of the time is just to install some program, which you can do easily via the graphical application.
You should be able to do all of your work in normal mode; copy and paste between places you own works perfectly with the graphical interface. Why and what are you trying to copy to /usr/bin
?
Best Answer
First, however tempted you might ever get, never "log in with root". It's far too easy to break things beyond repair. Anyway, this is disabled by default so you'd have to do a whole lot more to get to that point.
/usr/
is owned by theroot
account so to write files in there you need to write them as root. Two methods (there are undoubtedly more but here are the two main ways for most users):Press Alt+F2 to get a run dialogue and in that type
gksu nautilus
. This will open up a file browser window running as root. Copy your files across but be careful, you can nuke the system like this.A much more direct method is just loading up a terminal and writing:
(the
-R
is just there to recursively copy directories)If you ever want to fire off multiple commands as root without prepending them all with
sudo
you can runsudo -i
orsudo su
and you'll get a root terminal. But again, be careful what you do.