LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set default privileges of files and directories for particular user? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-default-privileges-of-files-and-directories-for-particular-user-4175496254/)

HariharanV 02-26-2014 04:59 AM

How to set default privileges of files and directories for particular user?
 
Hi All,

Whenever files and directories are created by particular user account, the default privileges of files and directories have to be 775.

I have tested with "umask 0002", made an entry in .bashrc file. But it is working for the directory and not for the files.

Thanks in advance.
Hariharan V

acid_kewpie 02-26-2014 05:35 AM

Not a networking question. Moved to Newbie.

markush 02-26-2014 06:22 AM

Quote:

Originally Posted by HariharanV (Post 5124927)
...
I have tested with "umask 0002", made an entry in .bashrc file. But it is working for the directory and not for the files.
...

One cannot set execute permissions via umask. You can only remove execute permissions from copied files.

umask 0002 will give you 755 for directories and 644 for files.

Markus

HariharanV 02-26-2014 06:49 AM

Thanks Markus.....

So how we can set 775 for directories and executable permission for files in umask?

Regards,
Hariharan V

markush 02-26-2014 07:20 AM

As I wrote, you cannot set execute permissions for files per umask. But it would be good if you'd describe what you want to achieve, maybe there's another solution to your problem.

Markus

pan64 02-26-2014 07:26 AM

http://www.grymoire.com/Unix/Permissions.html#uh-5
I do not think you can create files with execute flags, but probably I missed something...

HariharanV 02-26-2014 08:06 AM

Thanks to all....

Do we have any other then umask to set same permission for files and directories for particular user?

Regards,
Hariharan V

pan64 02-26-2014 08:07 AM

the chmod command. why do you need that?

HariharanV 02-26-2014 08:26 AM

Actually application (informatica ) team required that kind of permissions.

The user which they have mentioned is existing, so how we can set that kind of permission in chmod command?

Regards,
Hariharan V

pan64 02-26-2014 08:28 AM

chmod a+x filename will set execution flag on a file. by default you cannot create files with exec flag.

HariharanV 02-26-2014 08:35 AM

ok thanks for the help.....


All times are GMT -5. The time now is 09:36 PM.