LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2016, 01:40 PM   #1
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Rep: Reputation: Disabled
Question How can i make user always create files + folders with 775 permission ? Please help


Hello,

I am trying to achieve the following on Debian, i need to have testuser create all his files + folders with 775 permission, everything this user creates i would like for it to have that permission.

I would be VERY appreciative if someone could tell me how to do this.

---
What will also work would be some way i could set a folder to always have that permission no matter what is written in it and by who.
 
Old 12-05-2016, 01:56 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Have a look at umask.
 
Old 12-05-2016, 02:27 PM   #3
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lazydog View Post
Have a look at umask.

Reading about it but still no luck so far.
 
Old 12-05-2016, 03:25 PM   #4
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
Read some more?
 
Old 12-05-2016, 03:28 PM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
in the users .bash_profile or .bashrc file add the line:

Code:
umask 0002
You can just type 'umask' on the command line to see the current umask.
 
Old 12-05-2016, 04:28 PM   #6
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Thank you for your replies.

I have

umask 0002

If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick .
 
Old 12-05-2016, 04:37 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,622

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
If i create a new file via SFTP,
now that ads a twist
this is a REMOTE login

that should have been posted in the very first post and NOT just finding this out in post #6

what software are you using and what is the host?

and you REALLY DO NOT !!!!! want remote users using 775

Last edited by John VV; 12-05-2016 at 04:42 PM.
 
Old 12-05-2016, 05:09 PM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by ParanoiaUser View Post
Thank you for your replies.

I have

umask 0002

If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick .
This activity have any thing to do with apache?

Last edited by Habitual; 12-05-2016 at 05:10 PM.
 
Old 12-06-2016, 04:41 AM   #9
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
This activity have any thing to do with apache?
Nope.

--

So, i have 2 users, we'll call them user1 and user2.

User1 will have access to SFTP + SSH, user2 will have access only to FTP.

If user1 creates a file, user2 will not have write permission for that file when connected to FTP.

I need to give user2 write access to the file, how can i do this?
 
Old 12-06-2016, 07:48 AM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by ParanoiaUser View Post
Hello,

I am trying to achieve the following on Debian, i need to have testuser create all his files + folders with 775 permission, everything this user creates i would like for it to have that permission.

I would be VERY appreciative if someone could tell me how to do this.

---
What will also work would be some way i could set a folder to always have that permission no matter what is written in it and by who.
What is Umask and How To Setup Default umask Under Linux?
 
Old 12-06-2016, 10:48 AM   #11
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post


Quote:
Originally Posted by ParanoiaUser View Post
Thank you for your replies.

I have

umask 0002

If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick .
I've already tried to set that up .
 
Old 12-06-2016, 11:03 AM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by ParanoiaUser View Post
I've already tried to set that up .
you might have thought of this or tried it already, but have you tried using groups with them permissions/limits attached to it, then who ever is assigned to that group can, and them not attached to that group cannot?
 
Old 12-06-2016, 11:21 AM   #13
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,450

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hello

Maybe this has to do with SFTP? If the idea is that they can transfer files but not run scripts, I think you need to put the umask in the sshd config.

http://riaschissl.bestsolution.at/20...mask-for-sftp/
 
Old 12-06-2016, 11:46 AM   #14
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
you might have thought of this or tried it already, but have you tried using groups with them permissions/limits attached to it, then who ever is assigned to that group can, and them not attached to that group cannot?
I have added them like this in etc/group

user1:x:1000:user2
user2:x:1001:user1

Should i change something ? hmm.

Maybe they are not added correctly ?

Last edited by ParanoiaUser; 12-06-2016 at 11:49 AM.
 
Old 12-06-2016, 11:56 AM   #15
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Guttorm View Post
Hello

Maybe this has to do with SFTP? If the idea is that they can transfer files but not run scripts, I think you need to put the umask in the sshd config.

http://riaschissl.bestsolution.at/20...mask-for-sftp/
can execute just not write to is the only thing that the OP seems to be worried about.


Quote:
0775
user group other
setuid is unset can read can read can read
setgid is unset can write can write cannot write
Sticky bit is unset can execute can execute can execute
and that only pertains to other that the write permissions have been removed from.

Last edited by BW-userx; 12-06-2016 at 11:58 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
changing the default permission for both directory and files to 775 with umask fermat97 Linux - Newbie 1 11-14-2014 07:02 AM
New user group permission to only three folders without being owner zilexa Linux - Newbie 8 07-09-2014 11:57 PM
Can you make any files and folders created within a directory owned by another user?? helptonewbie Linux - Newbie 13 12-14-2007 04:21 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
permission 775 to all folders and sub... amer_58 Linux - Newbie 3 04-23-2005 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:40 PM.

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