Default user:group permissions while creating files and directories


 
Thread Tools Search this Thread
Operating Systems Linux Default user:group permissions while creating files and directories
# 1  
Old 08-30-2012
Default user:group permissions while creating files and directories

Hi,

I am working on setup a environment where only a specific user can upload the builds on htdocs of apache.
Now i want that a specific user can copy the builds on htdocs folder.

I created a group "deploy" and assign user1 and user2 to this group.
On Apache side i mentioned User=deploy and group=deploy in httpd.conf.

So the challenge is that i want if user1 or user2 login and they copied the builds on htdocs, default user and group will be deploy:deploy

Please help me on this.

Thanks,
Sunny
# 2  
Old 08-30-2012
If you set the group-sticky bit on a folder, files created in the folder will belong to the group of the folder.

I don't think you can do the same with the username, since you need elevated permissions to change the owner of a file...
# 3  
Old 09-08-2012
Sorry, user deploy is not allowed to execute '/bin/mkdir 1' as root on localhost

Hello,

I created a user who should have rights to work under /opt/lampp/htdocs directory. This directory is having below rights.

drwxr-xr-x 184 deploy deploy 12288 Dec 3 17:42 htdocs

i created a user deploy which belongs to deploy group
uid=502(deploy) gid=502(deploy) groups=502(deploy) context=root:system_r:hotplug_t:SystemLow-SystemHigh

but now when user deploy going to create any directory/files under /opt/lampp/htdocs, is giving the below error

Sorry, user deploy is not allowed to execute '/bin/mkdir 1' as root on localhost

Please let me know how to fix this.

Thanks,
Sunny
# 4  
Old 09-08-2012
What, exactly, does he do to try and create the directory? That message is very weird. It's not the usual error mkdir would give you for that. That it's saying he's trying to do so as root is doubly odd!

You need to make the directory group-writable, of couse -- chmod g+w -- but that hardly matters if he's not actually doing so as himself but as root!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Permissions on directories and files

Hello, I have a main directory called /test123 /test123 has lot of sub-directories and files. drwxr-x--- 21 root system 4096 Jan 25 10:20 /test123 Here, "other" does not have any access to /test123 folder. How can we provide read-only access to others on /test123... (1 Reply)
Discussion started by: aaron8667
1 Replies

2. Shell Programming and Scripting

Archiving and moving files into directories, creating directories, etc.

how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex. so mydemo--2015-03-23-1500.tar.gz > database -... (5 Replies)
Discussion started by: wyclef
5 Replies

3. Shell Programming and Scripting

Script to change Permissions on files and directories

Hey, It's me again. Have a problem, that's not really a problem. I have the below script, that goes to the directory I want it to go to. lists out the directories available, lets you choose the directory you want, then it changes the permissions on said directory. using chmod -R and chown -R. ... (2 Replies)
Discussion started by: gkelly1117
2 Replies

4. Web Development

Group and user permissions on mediawiki

I am working on setup a wiki which should have users and group having read or write permission. Before that we were using simple write to all methodology. Now the challenge is this that i have created a 3 users and all of the 3 are able to write to wiki and update the page. Now what i what to... (0 Replies)
Discussion started by: sunnysthakur
0 Replies

5. Red Hat

Issues with LDAP user/group permissions on NFS share

I can't seem to make sense of this. $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.2 Beta (Tikanga) $ $ mount /dev/sda2 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on... (6 Replies)
Discussion started by: dfinn
6 Replies

6. UNIX for Dummies Questions & Answers

how to change permissions only to files, not directories....?

Hi, I am really new to unix, any help is much appreciated. I need to change permissions of all files under several subdirectories to 700 but keep directories readable (755). Why ? Because I need a FTP user to only list his files and can't read them. But to browse to subfolder, the directories... (3 Replies)
Discussion started by: narrok
3 Replies

7. Shell Programming and Scripting

How can i copy user permissions(privileges) to a group

Hey there I have a problem and i was hoping that you guys could help me out I want to copy a user privileges to a group and i need to copy all privileges(Recursively) every directory with all its sub directories and I tried some solution and it did not work. I used the following command:- ... (14 Replies)
Discussion started by: The Dark Knight
14 Replies

8. UNIX for Dummies Questions & Answers

Newly created files default group and write permissions

Whenever I create a new file the group name is "dnn" and the file permissions are "-rw-r--r--". How do I get it so when I create files (with vi or other programs) that the default group is "sss" and the permissions are 770? (I am running HP-UNIX) Thanks, GoldFish (2 Replies)
Discussion started by: goldfish
2 Replies

9. Shell Programming and Scripting

Need help in changing Permissions to 775 for files and directories

Hi All I need to create a script which would change Permissions to 775 All the Files and directories will be mentioned in the Paramter files Can anyone give a Hint how to proceed in this ?? THanks (1 Reply)
Discussion started by: ranga27
1 Replies
Login or Register to Ask a Question