0

I'm using the LXDE desktop environment (trusty 14.04), the Chromium browser and the Text editor app.

The problem

When I edit a file under my username (/home/henrywright) everything works fine, but when I try to edit a file stored outside my user folder (for example /var/www/html) nothing happens after I save the document.

My first thought is this could be permissions related but I'm not sure how to solve the issue. How can I save a file that I'm working on in a directory outside my own user folder?

4 Answers 4

1

It just occurred to me that since you are trying to edit files in /var/www, all you need to do is add yourself to the www-data group and make some changes to director permissions

First:

 sudo adduser username www-data

Then change the directory owner and group

 sudo chown -R www-data:www-data /var/www/html 

allow the group to write to the directory

 sudo chmod 775 /var/www/html 

Now /var/www and any file or directory in it has group www-data permissions

Just log out and it again to make sure the group change takes effect

Then run from terminal

 groups username 

And it will list groups you are a part of. You should see www-data. If so, go try and edit file and it will work.

Sorry this didn't occur to me first.

Edit: just to clarify, you added yourself to www-data and allowed read/write on /var/www to anyone within group www-data.

When you open chromium, it will be opened as your user, that has permissions to access the files your trying to edit

0
0

Use an editor with super user permissions:

$ sudo nano path-to-file

To own a folder, use:

$ sudo chown -R username:group path-to folder

Then you can edit without sudo. group is optional.

0

Linux will not allow you to change system files that you don't own unless you declare you are root. You have to make changes with sudo privileges.

Open your editor or file manager with 'sudo' at the beginning. (sudo Pcanfm or sudo leafpad)

1
  • Thanks for the advice, but I'm using the Text app which is browser based (accessed via the Chrome web app store). Jan 4, 2015 at 13:50
0

You need to run the editor with sudo (or root privileges). Not sure you can do that with a Chrome app.

You may need to run chrome with sudo to get this to work.

From a terminal

 sudo chromium & 

But I don't know if there are any security implications that go with this. You may want to only use the app on the browser with sudo and search Internet in another instance.

You might be better off just using a regular text editor.

Edit: Did some searching and chromium won't even run as root, unless you make some changes, so that a pretty good indication not to run as root.

Again, you may want to find a text editor you like that can be installed (not an app). The screenshot looks very similar to something that does work, but the name escapes me

Edit: As discussed it was Brackets that I was thinking of, and you like it but no arm download. I am having issues compiling on my Raspberry Pi due to PhantomJS error, but you may have better luck

Make sure you have node installed.

 wget http://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz

 tar - zxvf node-v0.10.35.tar.gz 

Once extracted cd into node directory and do the usual

 ./configure 
 make
 sudo make install

Now git brackets

 git clone https://github.com/adobe/brackets.git 

Cd into Brackets directory

Run the following

 sudo npm install -g grunt-cli
 npm install 
 grunt 

Then sit back and wait. Hopefully it will build for you. Like I said I'm on a Raspberry Pi, and had issues with PhantomJS, but you may not.

8
  • The problem I have with finding a text editor is, my laptop uses an ARM processor and most of the decent editors out there that are available for Linux have been complied for Intel artchitecture Jan 4, 2015 at 13:43
  • The software that I was trying to think of before is called brackets if you want to look into it and see if seems like what you need. I won't be able to launch it to test it, but I am currently building it on my Raspberry Pi (arm chipset). So far so good, but it may take forever. Not much computing power on the pi
    – geoffmcc
    Jan 4, 2015 at 14:21
  • I love Brackets! I've been using that for the past year on my Windows PC. Problem is, it doesn't support my laptop's ARM architecture. See here for the issue I filed a few days ago on their GitHub support forum. Jan 4, 2015 at 14:43
  • Check out my edit on answer for instructions on how to compile on your own. It may work for you.
    – geoffmcc
    Jan 4, 2015 at 15:09
  • Thanks for the edit, I seem to be having trouble compiling Brackets too. How about running Chromium apps as root (not Chromium itself, just the app)? if that's possible, would that solve my issue? Jan 4, 2015 at 15:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .