[ubuntu] [SOLVED] File Permissions Reverting [Archive] (2024)

Ubuntu Forums > The Ubuntu Forum Community > Ubuntu Official Flavours Support > New to Ubuntu > [ubuntu] [SOLVED] File Permissions Reverting

PDA

View Full Version : [ubuntu] [SOLVED] File Permissions Reverting


DLLong

July 30th, 2008, 02:21 PM

I am converting a series of websites over to ubuntu/zencart. I am new to Linux and having a great time learning. One of the cautions from zencart is to change the file permissions for configure.php in a subdirectory. So here's what I did based upon other postings.
1. Opened the terminal and entered "sudo nautilus".
2. Browsed to the file in question and opened properties.
3. Went to the Permissions tab.

Now here's the problem. If I use the drop down for Owner, Group or Others to change the permissions from "Read and write" to anything else, I can click or select "Read only" but then it reverts back to "Read and write".

Can you help a newbie solve this problem?

Diabolis

July 30th, 2008, 02:52 PM

I think that is safer to do it through the terminal, rather than open a "sudo nautilus".

The commands that you'll need are: cd, chomd, ls

cd
Navigate through folders.
ex: cd Desktop/

ls -l
List the contents of a file, one per line. This will show you the permissions of each file.

chmod
Will change the permissions of a file.
If used recursively over a folder, it will change the permissions of a folder and the permissions of all its content.

For example if you want to remove the "write" permission, you would type the command like this:

chmod -w "file name"

vanadium

July 30th, 2008, 03:14 PM

Are you working on a file system that supports unix (Linux) permissions (ext3)? Windows file systems such as ntfs and fat do not support unix permissions.

DLLong

July 30th, 2008, 04:03 PM

I tried your suggestions. Let me take the second reply first. Yes, I am trying to change the file permissions on ubuntu directly.
Here's what I tried:
1. Navigated to the directory - dave@Aspenserver3:/media/disk/WSII/zencartfurn/includes
2. Entered in chmod -w configure.php
3. Received this in response: chmod: configure.php new permissions are r-xrwxrwx, not r-xr-xr-x
============
To check permissions, I entered: ls -l configure.php
Received this in response: -rwxrwxrwx 1 root root 3159 2008-07-29 13:20 configure.php
So this doesn't look like anything changed.
========
Since I'm still learning, I enter the same command as #2 above with this addition suspecting that it might have to do with the root permissions: sudo chmod -w configure.php
I received the same response as #3 above.

More thoughts?

Diabolis

July 30th, 2008, 04:11 PM

I would try with the verbose option to see if it throws any error messages.

sudo chmod -v -w configure.php

eightmillion

July 30th, 2008, 04:20 PM

I would do this from the command line also. But if you do do it from nautilus, I would suggest using "gksudo nautilus". I suspect that using "sudo nautilus" may be the cause of your problem.

DLLong

July 30th, 2008, 04:28 PM

I entered in your suggestion of: sudo chmod -v -w configure.php and received this in reply.

mode of 'configure.php' change to 0577 (r-xrwxrwx) chmod: configure.php: new permissions are r-xrwxrwx, not r-xr-xr-x

I checked the permissions with: ls -l configure.php and received -rwsrwsrws 1 root root 3159 2008-07-29 13:20 configure.php

Thanks for your help in resolving this.

DLLong

July 30th, 2008, 04:33 PM

I tried it with gksudo nautilus and had the same problem. I'm in the "Permissions" tab and go to the "Others/Access" drop down. Holding it down, it shows "None, Read only, Read and Write". I highlight with my mouse the "Read only" and it changes but as soon as I release it, it changes back to "Read and write."

Diabolis

July 30th, 2008, 04:38 PM

I checked the permissions with: ls -l configure.php and received
-rwsrwsrws 1 root root 3159 2008-07-29 13:20 configure.php

As you can see, the file is owned by "root" and belongs to the group "root".

So lets try to change the ownership and then the permissions.

sudo chown "your username" configure.php
sudo chmod -v -w configure.php

decoherence

July 30th, 2008, 04:39 PM

I tried your suggestions. Let me take the second reply first. Yes, I am trying to change the file permissions on ubuntu directly.

vanadium was actually asking about the format of the drive you're using, not whether you're trying to make the change within ubuntu.

you can type

fdisk -l

and it will tell you if you have NTFS formatted partitions.

Diabolis

July 30th, 2008, 04:44 PM

Yeah, I assumed that you knew about file systems. Just to be 100% sure try this:

sudo fdisk -l /dev/sda

crwmike

July 30th, 2008, 04:45 PM

I tried your suggestions. Let me take the second reply first. Yes, I am trying to change the file permissions on ubuntu directly.
Here's what I tried:
1. Navigated to the directory - dave@Aspenserver3:/media/disk/WSII/zencartfurn/includes
2. Entered in chmod -w configure.php
3. Received this in response: chmod: configure.php new permissions are r-xrwxrwx, not r-xr-xr-x
============
To check permissions, I entered: ls -l configure.php
Received this in response: -rwxrwxrwx 1 root root 3159 2008-07-29 13:20 configure.php
So this doesn't look like anything changed.
========
Since I'm still learning, I enter the same command as #2 above with this addition suspecting that it might have to do with the root permissions: sudo chmod -w configure.php
I received the same response as #3 above.

More thoughts?

If the permissions you want are r-xr-xr-x, the command is

sudo chmod 555 configure.php

vanadium

July 30th, 2008, 05:32 PM

Please post the output here of the command

mount

DLLong

July 31st, 2008, 03:43 AM

Sorry I was away for a while. I got to reading your posts and then it dawned on me what you were asking. The second drive (a former Windows drive) was probably formatted as NTFS. I checked and sure enough, it was. I reformatted it to ext3 and now it works perfectly.

I will admit that I ended up pulling what little hair I have left trying to figure out why the new drive was mounted but I could not copy directories into it. This whole "can't be an administrator" thing is driving me a little nuts.

JoneYee

July 31st, 2008, 03:49 AM

This whole "can't be an administrator" thing is driving me a little nuts.

It'll take a little getting used to fro mthe Windows World, but trust me, it'll save you enough times to be worth remembering that sudo is your friend.

decoherence

July 31st, 2008, 01:56 PM

Glad to hear you got it working!

This whole "can't be an administrator" thing is driving me a little nuts.

Well, in this particular case, it wasn't the permissions causing the problem but a characteristic of the NTFS filesystem.

But yes, getting 'permission denied' errors is frustrating to many users. RedHat's PolicyKit, which is new in Hardy, provides a solution. Future releases of Ubuntu will make better and better use of it, making administrative tasks much more straight forward. You'll still have to type in a password, but at least you won't have to re-do the command using gksudo or worse, going to the terminal.

raunhar

February 20th, 2009, 09:28 AM

I am also facing the same problem.

Can you explain the process step by step. I have just partly switched to linux. Using Ubuntu 8.10 and zen cart 1.3.8
Need to change file permission for configure.php

rewlad

March 31st, 2010, 10:05 PM

for some reason
chmod -w
did not worked for me.
I've solved with more specific:
chmod o-w

Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.

[ubuntu] [SOLVED] File Permissions Reverting [Archive] (2024)

FAQs

How to fix file permissions in Ubuntu? ›

To view and set the permissions for a file, right click it and select Properties, then select Permissions.

How to fix chmod 777? ›

There are two options to fix this issue:
  1. Reinstall - Copy off all pertinent data and then wipe the drive and reinstall with an up to date version of SLE.
  2. Restore - Restore from a full system backup taken before the change was made.
Aug 26, 2022

What is chmod 777 on root? ›

Access mode 777 over the root directory lets a normal user delete, move, or manipulate any file on the system. Thus, any user can make configuration changes to the kernel via the pseudo-filesystems. Of course, running the above wipes all system files and directories forever.

How do I give 777 permission folder and subfolders in Linux? ›

The chmod command allows users to modify access levels, and for directories like /var/www, setting permissions to 777 using “sudo chmod -R 777 /var/www” grants read and write access to all subfolders.

How to restore permission in Ubuntu? ›

For Ubuntu, the process goes like this:
  1. Open a terminal window (hit the key combination Ctrl+Alt+T)
  2. Type the command sudo apt-get install acl.
  3. Type your sudo password and hit Enter.
  4. When prompted type y and hit Enter.
  5. Allow the installation to complete.
Mar 3, 2016

How do I get full permissions on Ubuntu? ›

To give all permissions to all the users, use the following command: chmod -R a+rwx /path/.... Note: It's Usually not recommended to give every user every permission of a directory, be careful while using this command.

What is chmod 666 or 777? ›

A text file has 666 permissions, which grants read and write permission to everyone. A directory and an executable file have 777 permissions, which grants read, write, and execute permission to everyone.

What is the difference between sudo chmod 755 and 777? ›

777 - all can read/write/search. 755 - owner can read/write/search, others and group can only search.

How to rollback chmod 777? ›

On a "normal" system, you could fix this by booting from an install disk, mounting / (on the flash drive) as /mnt , running chmod 440 /mnt/etc/sudoers (as sudo). It might be worth trying this on an external system (being very careful) for the Rasberry Pi, just for practice.

How do I change the permissions of a root file in Linux? ›

Use the ls -l command to check file permissions and ownership in a directory. To change them, use chmod and write the new rules in a symbolic or numeric mode. Meanwhile, run the chown utility as a superuser to switch the file ownership to another account or group.

What is the difference between chmod 777 and 775? ›

The chmod 777 command grants the read, write, and execute permissions to all groups (owner, group, and everyone else). The chmod 775 command will grant the read, write, and execute permissions to the owner of the file or directory and to the group associated to it.

How to use chmod in Ubuntu? ›

To change directory permissions in Linux, use the following:
  1. chmod +rwx filename to add permissions.
  2. chmod -rwx directoryname to remove permissions.
  3. chmod +x filename to allow executable permissions.
  4. chmod -wx filename to take out write and executable permissions.
Jan 9, 2023

How to change file permission to 777? ›

To apply chmod 777 to a folder and its contents in Linux, follow these step-by-step instructions:
  1. Step 1: Open the Terminal. Open the Terminal application on your Linux system. ...
  2. Step 2: Navigate to the Folder. ...
  3. Step 3: Apply chmod 777 to the Folder. ...
  4. Step 4: Apply chmod 777 to the Contents. ...
  5. Step 5: Verify the Permissions.
Oct 21, 2023

What is chmod 777 command for single file? ›

- `0` (no permissions): No permissions to read, write, or execute the file or directory. So, when you run `chmod 777 <filename>` or `chmod 777 <directory>`, you are granting full read, write, and execute permissions to the file or directory for the owner, group, and others.

How do you change file permissions recursively in Ubuntu? ›

Changing permissions with chmod

To modify the permission flags on existing files and directories, use the chmod command ("change mode"). It can be used for individual files or it can be run recursively with the -R option to change permissions for all of the subdirectories and files within a directory.

How do I fix permission denied in Ubuntu? ›

So, if you want to solve a Linux permission denied error, you can check your privileges for the specific file or folder using the following command.
  1. ls -la.
  2. chmod flags permissions filename.
  3. chmod u=rwx,g=r,o=r file.
  4. chmod 744 file.
  5. chmod +x hello.sh.
  6. ./hello.sh.
Dec 12, 2023

How to fix file permission in Linux? ›

To change directory permissions in Linux, use the following:
  1. chmod +rwx filename to add permissions.
  2. chmod -rwx directoryname to remove permissions.
  3. chmod +x filename to allow executable permissions.
  4. chmod -wx filename to take out write and executable permissions.
Jan 9, 2023

How do I change user file permissions in Ubuntu? ›

To change permissions, use the chmod command. You can use symbolic or numeric methods. Symbolic Method: For example, to add execute permission for the owner.

What is chmod 777 command example? ›

Examples of Octal Mode
  • chmod 777 file.txt. The chmod 777 command gives all permissions to everyone for the file.
  • chmod 644 folder/ The command 644 gives the owner read and write permissions. ...
  • chmod 755 script.sh. The chmod 755 command gives the owner full permissions.
Jun 5, 2024

Top Articles
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5858

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.