Announcement

Collapse
No announcement yet.

[SOLVED] I'm not the owner of my owned files

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] I'm not the owner of my owned files

    Some days ago, I had have a problem with my session. Finally, I had to remove my user, and create a new one.
    Now, I have a problem. So Apache don't give permission to view any of my sites, I've made a test: I chmod'ed one web directory to 644. Theorically, I have permissions R and W. But if I try a "cd", it returns a "Permission denied"

    I've attached a image where it can be seen...
    Attached Files

    #2
    Re: I'm not the owner of my owned files

    Check all your other entries for directories - they are all executable.

    Do chmod +x and you should be able to cd into it.
    Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

    Comment


      #3
      Re: I'm not the owner of my owned files

      When you create a new user, Linux assigns a numeric ID to the user name. This number is used to record the file permissions, so that when you type on a console ls -l you get meaningful user and group names in the result instead of numbers.

      What probably has happened is that the new user has a different ID than the one you had before, and the rights in your folders were assigned to the old user ID. You could try the chmod trick, but perhaps you could try this:

      First, go to the parent of the folder that you were allowed to browse with the previous user but no longer are. Do a ls -l You'll get one or more lines like this

      drwxr-xr-x 7 1007 1007 912 2008-03-07 10:25 myfolder

      The user ID whose rights are associated with the drwx attributes is 1007 (the other number is the group ID) Remember that number because you'll need it later.

      Edit as root the file /etc/passwd. Look for a line like

      quisoc:1009:1009:Quisoc Name:/home/quisoc:/bin/bash

      (instead of quisoc you should look for your actual user name on the machine and the 1009 could be a different number) Then change the number 1009 with the one you remember from the previous step and save the file.

      What you've done is change the ID that is associated to the user name to the old number. Log off and on and see if this fixes your problem. Of course you'll not have then whatever rights you gave to the new user on any new files, etc....

      Now change the number 1009 for the

      Comment


        #4
        Re: I'm not the owner of my owned files

        Originally posted by toad
        Check all your other entries for directories - they are all executable.

        Do chmod +x and you should be able to cd into it.
        Thanks!!

        Comment


          #5
          Re: I'm not the owner of my owned files

          Thanks for the answer!
          But the solution was than easy as apointed toad: chmod +x.
          I can't acces any web on my pc because apache throw me a fordibben 403, and I think that the problem was the same with this directory, and it was more easy

          Originally posted by barbolani
          When you create a new user, Linux assigns a numeric ID to the user name. This number is used to record the file permissions, so that when you type on a console ls -l you get meaningful user and group names in the result instead of numbers.

          What probably has happened is that the new user has a different ID than the one you had before, and the rights in your folders were assigned to the old user ID. You could try the chmod trick, but perhaps you could try this:

          First, go to the parent of the folder that you were allowed to browse with the previous user but no longer are. Do a ls -l You'll get one or more lines like this

          drwxr-xr-x 7 1007 1007 912 2008-03-07 10:25 myfolder

          The user ID whose rights are associated with the drwx attributes is 1007 (the other number is the group ID) Remember that number because you'll need it later.
          Edit as root the file /etc/passwd. Look for a line like

          quisoc:1009:1009:Quisoc Name:/home/quisoc:/bin/bash

          (instead of quisoc you should look for your actual user name on the machine and the 1009 could be a different number) Then change the number 1009 with the one you remember from the previous step and save the file.

          What you've done is change the ID that is associated to the user name to the old number. Log off and on and see if this fixes your problem. Of course you'll not have then whatever rights you gave to the new user on any new files, etc....

          Now change the number 1009 for the

          Comment


            #6
            Re: I'm not the owner of my owned files

            Glad it worked.

            Could you mark the thread as solved, please? See my signature for details.

            Thanks.
            Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

            Comment

            Working...
            X