chmod

CHMOD a linux directory using PHP on an apache server

Has anyone ever used PHP (proven and successful) to CHMOD a directory through a Web Browser? My roadblocks are: (a) PHP script runs as "nobody" from the browser (b) directory above the one I want to CHMOD is owned by the ftp user and "nobody" does not have write permissions to it So when I try to chmod 0666 /usr/www/dirOwnedbyFTPuser/d...

Kohana image library chmod error

Hey, i am confused by this weird error i get, I have an upload form that works fine but when it tries to rewrite an existing image it throws a chmod error, however it only does it with images that existed on the server, so if i upload a pic and upload that same pic, it rewrites it successfuly, but will throw an error on pics that were up...

How to change/show permissions in C

Hi! I am new to C programming and I'd like to implement chmod command on files of a dir and subdir. How can I change/show permissions with a C code? Could someone help with a example? I would appreciate if anyone can provide me a code. ...

change permissions in C by using exec()

How can I implement chmod command on file by using exec? I would appreciate if anyone can provide me a code. ...

How can i get the source of a 777 - CHMOD php file?

A moderator of a forum i own did so. I still can't belive on it, and i can't understand how he did it. Can someone explain me? He said he used only HTTP GET requests The moderator said that the server (nginx) would normally send the output of the executed php files, but since that the files are 777 adding some parameters to the URL he c...

How to change the permissions on the files nested in subdirectories with single ack command?

I have the following directory tree. When moving around to/from VirutalBox, the file permissions are changed. So, I know/not that ack can be used to do it recursively from the command line. Can someone please show the command for ack to chmod 644 all the *.rb files? [~/dotfiles (master)⚡] ➔ tree . |-- cap_bash_autocomplete.rb |-- dotf...

CakePHP how to make webroot/js be writable

Creating a cache file with writeBuffer() requires that webroot/js be world writable and allows a browser to cache generated script resources for any page. how to make webroot/js be writable and allows a browser ..... ...

How do I give PHP write access to a directory?

I'm trying to use PHP to create a file, but it isn't working. I am assuming this is because it doesn't have write access (it's always been the problem before). I tried to test if this was the problem by making the folder chmod 0777, but that just ended up making every script in that directory return a 500 error message until I changed it...

PHP: Copying file permissions with fileperms and ftp_chmod

The overall goal: Copy the permissions of files from the local filesystem when uploading them over FTP using PHP. The problem: While ftp_chmod appears to succeed, and according to the print statement in the code I'm setting the right permissions, it sets completely wrong permissions. The code: $perms = fileperms($src); if ($perms !==...

SSH Chown problems

I have a webserver with multiple domain and user accounts setup. Recently I renamed one of the domain names and changed it's username correspondingly. However, this new user cannot access the data from the domain because it does not have the required permissions. How can I solve this problem? I've tried chown and I still cannot get acce...

php chmod mkdir

I want to know what is the safiest chmode for creating user folders and user files. I create a user folder for each registration (in mode 700) and users can upload images into their folder. I read the php documentation but I'm still confuse about terms "owner", "group", "public"? Can I have a full explanation about it? (I can't found a g...

Setting chmod for folders + index.html

Hey I am finishing up a small web-platform I have been doing in my spare time and am going to add a run once script that is executed at creation for each new webpage. The script will run code to restrict ftp access so that people cannot download the ftp includes, some of which contain sql details. What I was wondering was if adding bla...

How to `chmod -R +w` with Ant, files and folders?

I'd like to do the equivalent of a chmod -R +w foo/ in an Ant build script. So far I'm using this: <chmod perm="g+w"> <dirset dir="${basedir}/foo"> </dirset> <fileset dir="${basedir}/foo"> </fileset> </chmod> Is there a neater way to write that to include files and folders recursively? ...

LAMP web server file permissions

Hi SO, I've got a LAMP webserver running my homepage (index.html in var/www/). I'd like to know in general how to set my file permissions so that browsers can't access anything besides the html/php files I want to show. Right now I've sort of accidentally chmodded everything to 777. I understand that .htaccess only protects the www fo...

Secure chmod privileges?

The standard chmod privileges are "644" for files and "755" for directories, aren't they? In most cases, PHP doesn't need to write to files or directories. So couldn't I take the write privileges from all groups? I could assign "444" to all files and "555" to all directories. Wouldn't that be more secure? Thanks in advance! Note: ch...

How do I get around apache owning files uploaded to a PHP webserver?

Hey all, I am working on a PHP web app on a Linux web server for grades and documents for a course that I am co-teaching. The page I am writing at the moment is for submitting assignments, where the student selects an assignment from a drop-down menu and then uploads the assignment and submits. On submit, all the information about the s...

How to run sudo command as root?

Hello, I only have root access to my server and the sudo command therefore does not work. I am trying to run a command that tries to use the sudo command and as I already have root access, it fails. command not found: sudo chmod +x /usr/local/bin/wkhtmltopdf Is there a way that I can get this command to run? Can I move out of roo...

Calculating chmod.

Hello, Lets suppose I have a file with the permission 755 (rwxr-xr-x). I want to chmod g+rw to my file. To end up with 775. Whats the maths that takes place here to calculate that? I cant quite get my head around it thanks. Or similarly 640, to 660. Whats the formula taking place? http://articles.slicehost.com/2010/7/17/using-chmod-pa...

Why does recursive mode on chmod do everything but recursion?

chmod -R 775 *.cgi only changes permissions on the files in the current directory, the files in the subdirectory don't get modified at all. This is the exact same functionality as simply doing chmod 775 *.cgi. I have seen people use solutions such as with find and whatnot. Ok great, but why does -R mode even exist if it doesn't even acco...

Rename file permission

I am trying to copy over some files pulled out from a zip folder, from out of the directory. I modified the code from this page http://stackoverflow.com/questions/859396/extract-directory-inside-zip for the most part it works, but when it is attempting the rename the directory files it pulls I get the following error Warning: rename...