Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Get root access for copying files to

/usr/share/…?
Ask Question
Asked 10 years, 3 months ago
Active 2 months ago
Viewed 194k times
15
13
To be short, I want to copy a folder to a location /usr/share/screenlets/.... in Ubuntu 10.04
system. I tried by logging in as root from terminal giving su.

I even changed my user account type to ADMINISTRATOR; Yet, no use. PASTE option in the
context menu's list in the folder /usr/share/... is INACTIVE.

How can I copy those files?


command-line permissionssecurityroot

Share
Improve this question
Follow
edited Sep 25 '14 at 8:52

αғsнιη
31.2k3333 gold badges119119 silver badges181181 bronze badges
asked Oct 30 '10 at 14:32

Vinay
3,44166 gold badges1919 silver badges2222 bronze badges
Add a comment
5 Answers

Active OldestVotes

26
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 the root 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):

1. 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.
2. A much more direct method is just loading up a terminal and writing:
3. sudo cp -R /path/to/files/you/want/copied/ /copy/to/this/path/
(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 run sudo -i or sudo su and you'll get a root terminal. But again, be careful what you do.

Share
Improve this answer
Follow
edited Apr 3 '17 at 13:57

Zanna♦
61.5k5151 gold badges171171 silver badges290290 bronze badges
answered Oct 30 '10 at 15:14

Oli♦
265k104104 gold badges628628 silver badges804804 bronze badges
 1
...or sudo gnome-terminal. – Nathan Osman Nov 16 '10 at 5:46
 2
@George: Running graphical application with sudo is not a good habit. Just go through this
article: psychocats.net/ubuntu/graphicalsudo – aneeshep Nov 16 '10 at 8:38
 gnome-terminal -e "sudo -i" seems a more reliable method for a root terminal. The graphical
terminal itself doesn't need to run as root and I'm sure the user would prefer their preferences applied. – Oli♦ Nov 16
'10 at 9:09
 1
I am using 14.04 and Alt+F2 no longer seems to work. – posfan12 Feb 3 '15 at 2:59
Add a comment
4
You need root access. You can launch nautilus with root access with gksu nautilus or can issue
commands with sudo before the command to move or copy. I would not play around with user
groups if I were you, as this can mess things up and spoil built in security features.

Share
Improve this answer
Follow
edited Apr 3 '17 at 13:58
Zanna♦
61.5k5151 gold badges171171 silver badges290290 bronze badges
answered Oct 30 '10 at 14:38

LinuxCanuck
47622 silver badges33 bronze badges
 @^ Thanks for the reply, i wouldn't do it either hereafter. :) – Vinay Oct 30 '10 at 17:13
Add a comment
3
You can also install Ubuntu tweak and then go to manage scripts . There you will find a script called
Browse as root . It will ad a new entry to the context menu wich will alow you browse the selected
folder as root.

You just right click from nautilus ... browse as root ... enter password and you can do whatever you
want.

Share
Improve this answer
Follow
answered Nov 16 '10 at 14:00

Valentin
5122 bronze badges
 I had Ubuntu tweak installed. But, didn't know ur tip. – Vinay Nov 21 '10 at 18:34
Add a comment
2
There is a simple way to do it :

press Alt+F2 to open the 'Run Application' box


type gksudo nautilus in to the text box and press 'Enter'. This will prompt a password dialog box.
Enter your sudo password and it will open nautilus with root privilege. From there you can
move/copy files without any permission error.

Note: Just make sure that you don't delete/replace any system files.

see a similar post here:

Share
Improve this answer
Follow
edited Apr 13 '17 at 12:23

Community♦
1
answered Nov 16 '10 at 6:13

aneeshep
27.1k1212 gold badges6060 silver badges7474 bronze badges
 Even gksu nautilus works. – Vinay Nov 16 '10 at 8:23
 @Vinaychalluru: yea. of course – aneeshep Nov 16 '10 at 8:42
Add a comment
2
Right click anywhere on a blank desktop. Click create launcher.

Type = application
Name = whatever you want it to be
Command = /usr/bin/gksu nautilus
Comments = whatever you want it to be
Double click the new launcher on your desktop. Note that anything you want to copy and paste must
be done in this browser, you cannot simply drag onto your user desktop space, so if you need to open
to browsers just double click the new launcher twice. Welcome to drag and drop root.

Remember that you can replace nautilus with whatever your favorite browser is, you might try xfe,
so after dl of xfe command would be /usr/bin/gksu xfe. If you would like to make an OpenAs that
you can manually type any program you want to run as root, Command = /usr/bin/gksu.

You might also like