Loltuttifruitti
Posts: 2
Joined: Wed Jul 01, 2015 10:19 pm

I can't move or delete files( I don't have permission)

Wed Jul 01, 2015 10:27 pm

I'm ne to the raspberry pi stuff and anyway I installed Apache to start a web server and it works. I'm using raspbian(noobs package). Only problem is the when I go to /var/www/index.html, it won't let me delete it or move it because permission is denied. How do I get permission? Thanks!

W. H. Heydt
Posts: 12655
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: I can't move or delete files( I don't have permission)

Thu Jul 02, 2015 4:14 am

First...do an "ls -l" to find out who owns the files (probably root). This is more for information than anything else.

Second be *certain* that you are doing what you want to do. Take a backup anyway in case you make a mistake.

Third, prefix you commands with "sudo" (e.g. "sudo rm <filename>" to delete a file). That will mean that you are running the command as if you were logged in as root. Root has permission to do anything to the system...when a command is run by root, permissions are ignored.

Note: You can run a single command as root that will delete *all* files on the system. I am *not* going to give that command in this Forum because someone would be sure to use it and then complain that it actually worked...and blame me that it did.

Loltuttifruitti
Posts: 2
Joined: Wed Jul 01, 2015 10:19 pm

Re: I can't move or delete files( I don't have permission)

Thu Jul 02, 2015 6:54 pm

W. H. Heydt wrote:First...do an "ls -l" to find out who owns the files (probably root). This is more for information than anything else.

Second be *certain* that you are doing what you want to do. Take a backup anyway in case you make a mistake.

Third, prefix you commands with "sudo" (e.g. "sudo rm <filename>" to delete a file). That will mean that you are running the command as if you were logged in as root. Root has permission to do anything to the system...when a command is run by root, permissions are ignored.

Note: You can run a single command as root that will delete *all* files on the system. I am *not* going to give that command in this Forum because someone would be sure to use it and then complain that it actually worked...and blame me that it did.
How do I become root on th desktop interface? I'm on the actual desktop trying to drag files. Will I have to move them from my usb to a folder through terminal? If so what comman would that be?

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: I can't move or delete files( I don't have permission)

Thu Jul 02, 2015 7:58 pm

Loltuttifruitti wrote: How do I become root on th desktop interface? I'm on the actual desktop trying to drag files. Will I have to move them from my usb to a folder through terminal? If so what comman would that be?
Open an LXTerminal window and use the sudo -i command. Everything you do in the window after that runs as root.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

solo2500
Posts: 123
Joined: Sat Jul 09, 2016 12:38 am

Re: I can't move or delete files( I don't have permission)

Mon Oct 29, 2018 2:52 pm

Open an LXTerminal window and use the sudo -i command. Everything you do in the window after that runs as root.

Is there a way to do this using the file manager?
I'm a total novice, non-programer (...basically a hack.)

W. H. Heydt
Posts: 12655
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: I can't move or delete files( I don't have permission)

Mon Oct 29, 2018 3:27 pm

solo2500 wrote:
Mon Oct 29, 2018 2:52 pm
Open an LXTerminal window and use the sudo -i command. Everything you do in the window after that runs as root.

Is there a way to do this using the file manager?
Yes...but running as root is discouraged because if you forget that you're running as root, you can create what used to be described as "On a clear disk, you can seek forever." Basically, if you are logged in as root, then everything you run will be as root. If you can't figure it out from there, you probably shouldn't be doing it anyway. See my first comment in this thread.

(I have an old SuSE system that addressed this issue by having the desktop wallpaper covered in exclamation points and "bomb" images...all on a bright red background. No way to miss that you are logged in as root.)

User avatar
HawaiianPi
Posts: 5838
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: I can't move or delete files( I don't have permission)

Mon Oct 29, 2018 6:59 pm

As others have said, if you don't know how to do this already, you will probably end up messing up your system.

But to answer your question, open a terminal and enter,

Code: Select all

gksudo pcmanfm
to launch a root file manager.


You can add a Root File Manager entry to the Raspbian menu.

Menu > Preferences > Main Menu Editor
Click on Accessories, then new item and fill out as follows:
Image

You should also see an entry for a Root Terminal that is not enabled, so I enabled that while I was in there.

And here are a couple of custom icons I made for them (matching the Pixel/RPi Desktop style icons).
Image Image
Grab those pics and click on the default icon in the corner of the box you edit when creating the root file manager menu entry (also located in properties when editing the menu), then select your desired picture.

*** Using this improperly will will break your system! ***
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “Beginners”