LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2014, 04:59 AM   #1
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Rep: Reputation: 0
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
 
Old 02-26-2014, 05:35 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Not a networking question. Moved to Newbie.
 
Old 02-26-2014, 06:22 AM   #3
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by HariharanV View Post
...
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
 
Old 02-26-2014, 06:49 AM   #4
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Original Poster
Rep: Reputation: 0
Thanks Markus.....

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

Regards,
Hariharan V
 
Old 02-26-2014, 07:20 AM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
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

Last edited by markush; 02-26-2014 at 07:23 AM.
 
Old 02-26-2014, 07:26 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,846

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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...
 
Old 02-26-2014, 08:06 AM   #7
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Original Poster
Rep: Reputation: 0
Thanks to all....

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

Regards,
Hariharan V
 
Old 02-26-2014, 08:07 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,846

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
the chmod command. why do you need that?
 
Old 02-26-2014, 08:26 AM   #9
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Original Poster
Rep: Reputation: 0
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
 
Old 02-26-2014, 08:28 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,846

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
chmod a+x filename will set execution flag on a file. by default you cannot create files with exec flag.
 
Old 02-26-2014, 08:35 AM   #11
HariharanV
Member
 
Registered: Aug 2010
Posts: 49

Original Poster
Rep: Reputation: 0
ok thanks for the help.....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I cant connect to the database, i need to set user privileges tompa Linux - Newbie 10 07-20-2013 07:01 AM
Default ownership of files and directories linuxdevil Linux - Security 4 06-02-2011 06:25 AM
How to assign read privileges to user on specific directories and files zaeem Linux - General 13 02-01-2011 05:51 AM
ACLs, default permissions, directories and files hydraMax Linux - Security 11 01-12-2011 06:19 AM
can you set a default umask for only certain directories? BrianK Linux - General 3 06-14-2004 09:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration