Find the answer to your Linux question:
Results 1 to 7 of 7
Hello community. Can you please answer how to create new files with default permission 664 instead of 640? Regards, sevmax...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    7

    664 permission for new files. how?

    Hello community.
    Can you please answer how to create new files with default permission 664 instead of 640?

    Regards,
    sevmax

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    change your umask
    You can change your umask in /etc/profile or /etc/bashrc
    Default value should be 022 change it to 026
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    7
    at /etc/profile wasn't those information.
    I changed it inside /etc/bashrc
    if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then
    umask 026
    else
    umask 026
    fi
    But result the same. When new user create file - it has 640.
    New files are created throught FTP connection. Can it change situation?

  4. #4
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Quote Originally Posted by self_ru View Post
    at /etc/profile wasn't those information.
    I changed it inside /etc/bashrc


    But result the same. When new user create file - it has 640.
    New files are created throught FTP connection. Can it change situation?
    /etc/profile or /etc/bashrc ...that depends on distro.

    Sorry, I mistaken I thought its 640 Instad of 644.
    change the umask to default it should be 022, which creates files with 644 by default in most distros.

    022 umask will create files with 644 default permissions.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  5. #5
    Just Joined!
    Join Date
    Dec 2007
    Posts
    7
    I set it 022
    For SSH access it works, but for FTP access - not. Can you please promt how to create files with 0664 permission throught FTP? To loging at FTP I use real user, not virtual.

  6. #6
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by self_ru View Post
    I set it 022
    For SSH access it works, but for FTP access - not. Can you please promt how to create files with 0664 permission throught FTP? To loging at FTP I use real user, not virtual.
    When you login via ftp you don't get a true shell, unlike on ssh. So any shell related stuff (like /etc/profile or the rest of bash initialization files) are completely unrelated. You need to check the documentation for whatever ftp server you are using.

  7. #7
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    What ftp server you are using.

    if you are using vsftpd.

    check this in vsftpd.conf

    local_umask=022
    anon_umask=022
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

Posting Permissions

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