Results 1 to 4 of 4

Thread: Auto CHMOD

  1. #1
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Auto CHMOD

    I have a web and ftp server set up on my ubuntu box. Every time I upload a file via ftp however, I have to CHMOD the file to any readable value. For example, when uploading a .html file and trying to access it via the web, I get a Forbidden error. If I CHMOD the file to 644, it works just fine. Is there anyway I can set the server to automatically CHMOD the files for me or something? I mean, doing this myself isn't that big of a deal, but if there's a fix, it'd be great!

  2. #2
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Auto CHMOD

    Quote Originally Posted by m3bik View Post
    I have a web and ftp server set up on my ubuntu box. Every time I upload a file via ftp however, I have to CHMOD the file to any readable value. For example, when uploading a .html file and trying to access it via the web, I get a Forbidden error. If I CHMOD the file to 644, it works just fine. Is there anyway I can set the server to automatically CHMOD the files for me or something? I mean, doing this myself isn't that big of a deal, but if there's a fix, it'd be great!
    Use the sticky bit. See here.
    -BAB1

  3. #3
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Auto CHMOD

    While that looks like it might be what I need...but no tutorials seem to be doing me any good.

    Everything I find just explains the permission settings in chmod and I've found mentioning about sticky group or user, but nothing that is helping in any way, shape, or form. ????



  4. #4
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Auto CHMOD

    Quote Originally Posted by m3bik View Post
    While that looks like it might be what I need...but no tutorials seem to be doing me any good.

    Everything I find just explains the permission settings in chmod and I've found mentioning about sticky group or user, but nothing that is helping in any way, shape, or form. ????


    Before going into what SETUID and SETGID bits are, maybe we should backup a bit and look at what permissions and ownership of the directory in question.

    Quote Originally Posted by m3bik
    I have a web and ftp server set up on my ubuntu box. Every time I upload a file via ftp however...
    When you upload a file, who are you logged in as? Where in the filesystem are you uploading to? Provide us with the output of
    Code:
    ls -l
    for the directory and the files in that directory. This is my web directory for example.
    Code:
    drw-r--r-- 6 bruce bruce    4.0K 2009-10-22 10:06 public_html
    and the file(s) in that directory are
    Code:
    -rw-r--r-- 1 bruce bruce      14K 2009-10-07 23:23 index.html
    -rw-r--r-- 1 bruce bruce    5.1K 2009-10-21 23:42 index.html.1
    This is just a guess, as I can't see the file structure or the ownership of the directory, but I believe that the owner:group is not what you think it is.

    The default umask is set to 022 (chmod 644). If you are logged in and create a file the perms should be 644 already. Are you moving files that you do not own (using sudo) or could the files be in a directory that does not have unix (posix) file perms (i.e. vfat or some such)?

    The SETUID and SETGID bits force the ownership to the owner or group of the directory and stop deletion by anyone but the owner (and root of course).

    Lots to think about, but I need to see what you have before I can advise you on what to do.
    -BAB1

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •