Editing HTML Files

Can anybody tell me how to edit my /var/www/html file?
When I try to move/copy or edit the file it tells me I don’t have permission, I am the only user of this machine and assume I have ADMIN rights.
Also, Same problem with a shared public folder made through SAMBA.
I can access the shared public folder from all PC’s on my network, add files and so forth, but when working within the share on Lubuntu machine, I get the permission error again.

ls -l /var/www/html
from a command prompt.

Normally, you don’t edit the files under /var/www/hmtl, because it is the directory of the webserver.
Normally, you have a working directory, where you edit the files (versioned with git or another CVS). And then you deploy the files under /var/www/html.

If you are just testing a bit, I would setup a minimal Linux server with a webserver. Then you can access the webserver from your host with SSH and/or FTP.

No, if you see the error, that you don’t have the permission to edit, than it means, that you don’t have the permission. The standard file permissions are quite simple. I am quite sure, that you are not the owner of the file. And your are surely not in the group, that owns the file. And all the others don’t have permissions to avoid problems.
You should change your workflow. Another possibility is, that you add your user to the group, that owns the files under /var/www/html.

And if you look at cat /etc/passwd, there are a lot of (technical) users. You are not alone on the system.

For Samba, please open a new topic.

This is the results:
$ ls -l /var/www/html
total 16
-rw-r–r-- 1 root root 10918 Aug 14 05:07 index.html
drwxr-xr-x 2 root root 4096 Aug 17 11:45 old

(old) is highlighted in blue. Problem?
Still can’t edit.

All I want to do is replace the default index.html file that came with the system. Make a folder, which I can do. Move that file to that folder, which I can’t. Then drop my own company index.html file in it’s place for browser home page.
I edit this file all the time in WINDOWS, but having trouble in this new Lubuntu machine.I don’t feel I need fancy editing programs to change a simple file. I just need admin rights.

As you can see, the owner of the file index.html is the user root, which can read and write the file. Users in the group root can read the file. All the others can only read the file.

If you have the new index.html somewhere in your home directory, than you can copy the file with elevated privileges: sudo cp /path/to/new/index.html /var/www/html/index.html

That worked! Thank you so much.
I will do some reading up on changing permissions.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.