Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Linux Mint. I set up an administrator account called 'thomas'.

I am trying to edit some files and it will only let me open them as read only. I assumed a permissions problem. As such, I sought to give myself the correct permissions.

I added my user to the group sudo (it was already in the group admin). In sudoers these groups have all permissions. However, this did not work so I added an entry specifically for my username to give it all permissions. Again, this has not worked.

As such, at the moment I can log in as root or put sudo in front of every command to get things working, but this is not ideal and does not help when, for example, I open up a document for editing in Gedit within the GUI.

Could anyone advise as to why my permission changes are not working?

share|improve this question
Where are the files you are trying to edit? in your home directory? Can you give us the output of ls -Al in the directory of the files you're trying to edit? – Rob Jul 24 '12 at 15:23

This is from my Red Hat-based desktop knowledge:

In a terminal do su and then visudo and then scroll down and look for:

root    ALL=(ALL)       ALL

Press i so you're in insert mode. Copy/paste the above line and replace root with your username, leave the rest as it is.

share|improve this answer
I have done this, and it hasn't worked - this is my question :) – Thomas Clowes Jul 24 '12 at 14:12

Do you mean you can not edit files in /home/thomas without sudo? In that case change the ownership/permission of the files with chown and chmod respectively.

Editing files elsewhere on the file system will normally require administrative privileges.

share|improve this answer

Try backing up your /etc/sudoers file (su -c 'mv /etc/sudoers /etc/sudoers.bkup') then uninstalling and reinstalling sudo (su -c 'apt-get remove sudo && apt-get install sudo')

When su -c asks for a password, it is asking for root password.

While I don't recommend doing this, it may be possible if you change the uid for thomas to 0. This should be possible with sudo vim /etc/passwd (use whatever file editor you use).

share|improve this answer
I did this. It reinstalled. The sudoers file stayed the same, and the problem persists. – Thomas Clowes Jul 24 '12 at 17:38
Can you edit the output of ls -Al in the directory of the files you're trying to edit into the question? – Rob Jul 24 '12 at 17:44

Fix permissions within user thomas: (as Thor suggested)

find /home/thomas -type f -exec sudo chown thomas:thomas {} \;
find /home/thomas -type d -exec sudo chown thomas:thomas {} \;

find /home/thomas -type f -exec sudo chmod 640 {} \;
find /home/thomas -type d -exec sudo chmod 750 {} \;


Files not located in /home/thomas will not have permissions for you to edit without sudo.

This is normal! It's critical for maintaining a safe running system.

share|improve this answer
To clarify.. When logged in as user 'thomas' I can edit files in my Home directory. I cannot however edit files in the htdocs section of my xampp install located at /opt/lampp/htdocs I could change the ownership of these files (which i believe is what your code accomplishes), but I was trying to find a find all remedy - I want my account 'thomas' to be able to do everything. Could you clarify on your 'Important' - why?/What has adding thomas to the group sudo and giving all permissions to thomas actually achieved? Thanks – Thomas Clowes Jul 24 '12 at 17:44
user account thomas shouldn't be able to do everything. *nix works with the principle of least privilege. thomas shouldn't be able to do everything, root should. – Rob Jul 24 '12 at 18:02
thanks Rob for providing him with the link, kid wouldn't let me get here. lol .. Now i advise against this but he could change the permissions on /opt/lampp/"""htdocs""" lampp:lampp or what ever the owner is and set file perms as 664 then simply add himself to that group. Sorry for the long winded comment lol. – tao Jul 24 '12 at 18:36
Ok - thanks for the info.. so.. I wanted to install xampp to use for testing my websites. I could not do it from the user account 'thomas' as it didnt have the required priveleges.. so i logged into root and installed it. tao - you seem to be suggesting that giving 'thomas' priveleges to edit files in opt/lampp is inadvisable? why? If so is the assumption that i should just use root for my webdesign? – Thomas Clowes Jul 24 '12 at 19:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.