file-permissions

How to give file permission to a specific user in a Group?

旧街凉风 提交于 2019-12-03 23:42:06
I have a Group 'g1' having 2 users Alice and Bob. I want to share a file 'file1' with both of them with different permissions.(for Alice read only and for Bob Read+write) Assuming Bob can own the file the following should work for you. $ chown Bob:g1 file1 First set the ownership of the file to Bob to allow for read+write access and set the group ownership to the g1 group. $ chmod 640 file1 Set the owner to a read and write and set the group to read only. This is a common permission structure on webservers. Note that the "world" has no permissions in this structure, but $ man chmod can provide

How to recursively change the owner and group on a directory with Chef?

大兔子大兔子 提交于 2019-12-03 22:21:56
the resource_directory has only 2 actions available: create and delete I need to update the owner and group of a directory recursively. How do I do that? using a simple resource_execute ? execute "chown-data-www" do command "chown -R www-data:www-data /var/www/myfoler" user "root" action :run end Bill Warner You can set the default action to nothing then have resources that may screw things up notify the perm fixer: execute "chown-data-www" do command "chown -R www-data:www-data /var/www/myfoler" user "root" action :nothing end resource "that may screw up perms" do stuff "one two three"

PHP/Apache Deny folder access to user but not to script

心已入冬 提交于 2019-12-03 19:38:52
问题 So I have this php web app, and one of my folder contains some files that can be downloaded. I have a download script that modifies the headers, in order to always offer a download link. (instead of showing a picture for example, when you click on a link, a download box pops out) Right now, if you enter a url like: http://www.mywebsite.com/content/ You get the listing of all the downloadable files, and of course, you can just download them all, without going through the website interface.

Microsoft VBScript runtime error '800a0046' Permission denied

别来无恙 提交于 2019-12-03 16:26:19
I get the following error: Microsoft VBScript runtime error '800a0046' Permission denied When running a classic asp application. The error is here: (in the CreateTextFile line) Dim myFSO set myFSO = Server.CreateObject("Scripting.FileSystemObject") myFSO.CreateTextFile(fName) I know I can get around this problem by giving "Full control" to the "Everyone" user. This is a publicly accessible folder on our server, so I worry that this is a security risk? I would prefer to be able to give full permission to someone like "IIS_IUSRS", but this doesn't work. It's as if it's a different user being

Use Maven assembly plugin to set Linux file permissions even when run on other platforms?

余生长醉 提交于 2019-12-03 16:23:29
问题 Similar question: Can Ant's tar task set a Linux file permission even when the task is used on other platforms? If I use Maven 2 assembly plugin with the 'project' descriptor, is there a way to set shell script permissions to executable for example for included build.sh script files? Example: <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2</version> <configuration> <descriptorRefs> <descriptorRef>project</descriptorRef> </descriptorRefs> </configuration> </plugin> This

Permissions required to move file to different directory in Unix/Linux [closed]

五迷三道 提交于 2019-12-03 16:16:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I would like clarification on the permissions required, in order to move a file A from directory B to directory C (the command would be "mv B/A C/A", I think), with name unchanged. Am I correct to think that the following are required? The user/group doing the move must have write permission for directory B (or

Unsync'd Git Repository in Dropbox

江枫思渺然 提交于 2019-12-03 13:23:15
问题 I have a git repository (and working directory) that is stored in my Dropbox so I can move back and forth between computers without having to commit or stash (read: without any effort at all). This is working great except for one minor annoyance that is becoming a major annoyance. Every so often, I'll leave one computer in a fully committed state only to pick up on the other computer and find that a git status reports changes. Inevitably, those changes are related to permissions. What I'm not

Can I write a file to a folder on a server machine from a Web API app running on it?

眉间皱痕 提交于 2019-12-03 12:24:25
I have this code in my Web API app to write to a CSV file: private void SaveToCSV(InventoryItem invItem, string dbContext) { string csvHeader = "id,pack_size,description,vendor_id,department,subdepartment,unit_cost,unit_list,open_qty,UPC_code,UPC_pack_size,vendor_item,crv_id"; int dbContextAsInt = 0; int.TryParse(dbContext, out dbContextAsInt); string csvFilename = string.Format("Platypus{0}.csv", dbContextAsInt); string csv = string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12}", invItem.ID, invItem.pksize, invItem.Description, invItem.vendor_id, invItem.dept, invItem.subdept

Symlink giving “Permission denied”… to root

人盡茶涼 提交于 2019-12-03 12:02:46
I wrote a simple script to automate creating a symbolic link. #!/pseudo today = "/tmp/" + date("Y-m-d") exec("ln -sf " + today + " /tmp/today") Simple enough; get today's date and make a symlink. Ideally run after midnight with -f so it just updates it in-place. This works just fine! ...for my user. xkeeper /tmp$ ls -ltr drwxrwxrwx xkeeper xkeeper 2014-10-21 lrwxrwxrwx xkeeper xkeeper today -> /tmp/2014-10-21/ xkeeper /tmp$ cd today xkeeper /tmp/today$ cd .. Notice that it works fine, all the permissions are world-readable, everything looks good. But if someone else wants to use this link (we

Keep permissions on files with Maven resources:testResources

守給你的承諾、 提交于 2019-12-03 09:30:14
Is it possible to keep permissions on file with Maven resources:testResources? My use case is a Selenium binary driver that I put in /src/test/resources that I would like to be able to use from my tests. My -rwxr-xr-x is however changed to -rw-r--r-- in target/test-classes. wjans This seems to be a bug in the Maven Resource Plugin If you are using the Maven Assembly Plugin, you can configure the file permissions there. If not, you might consider a workaround. You could do this via Ant by doing something like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun