Find the answer to your Linux question:
Results 1 to 8 of 8
dear all im trying to find out how is the file permission is defined? for example when i use the command list -l testp01.txt i get the result of testp01.txt ...
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    5

    file permission

    dear all
    im trying to find out how is the file permission is defined?

    for example when i use the command
    list -l testp01.txt
    i get the result of testp01.txt file permission -rw- r-- r-- root root etc
    however i wonder where are those information written?

    is there any special file which contains all of these information?
    --

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    If I remember correctly. The permisions are kept in the inode. inode - Wikipedia, the free encyclopedia
    There is no file which contains this info, because it exists on a level lower than the filesystem.

    You have a hardware disk (hard drive) that is partitioned into spaces (partitions) that are either allocated to raid, lvm or the like, or have filesystems written to them (such as EXT2/3/4, NTFS, FAT, etc.) Files are then written on top of the filesystem. Permisions exist as part of the EXT2/3/4 stage, and are lower than Files.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Posts
    5
    dear all
    what I've studied turn out that umask is able to set the default permission of each user.
    however I've no idea how to use 'umask'.
    do you have any suggestion?

    thank you very much

  4. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    did you google for umask?

    there is also
    umask --help

    and
    man umask

    and
    info umask
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  5. #5
    Just Joined!
    Join Date
    Jan 2010
    Posts
    5
    dear all
    I've been able to use umask to control the file default permission
    however whenever I use umask command, which file's information is changed?
    I mean I want to find out which configuration file and which information are used together with umask

    thank you very much

  6. #6
    Just Joined!
    Join Date
    Jan 2010
    Posts
    5
    Dear all
    I found out that the umask can be set from the /etc/csh.cshrc and /ect/csh.login
    I've tried but failed

    do you have any suggestion?
    thank you very much

  7. #7
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I don't know exactly where the user's present umask is stored, but you can set it automatically for a user everytime that he logs in by adding it to his shell's resource file.

    It looks like you tried to use the resource file for csh: are you using csh? Run the command:
    Code:
    echo $SHELL
    This will tell you the shell that you are using. Unless you have changed it, the value will probably be /bin/bash. This means you are using the Bash shell.

    In this case, you can set a user's umask automatically by changing their /home/user/.bashrc file. This file is loaded by Bash whenever it starts, and is just a simple shell script. Therefore, to set a user's umask to 0660, just add the line:
    Code:
    umask 0660
    to their /home/user/.bashrc.

    Does this help?
    DISTRO=Arch
    Registered Linux User #388732

  8. #8
    Just Joined!
    Join Date
    Jan 2010
    Posts
    5
    thanks cabhan
    I've got what I want

Posting Permissions

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