Questions tagged [chmod]

0

votes
0

answer
2

Views

Why it is not possible to set permission on FAT fs?

chmod and mount from util-linux ackts unpredicteble when working under normal user, there is no any whey to set permission.
Hellseher
0

votes
0

answer
17

Views

mkdir (“dir”, 0777) and chmod (“dir”, 077) not working

in short, the following code is meant to created a directory structure like Attachments Lot Layer The Attachments directory is fixed. The Lot comes out with 0777 permissions. The Layer directory does not. I added the chmod lines after concern that perhaps umask was at fault, but it changed nothin...
user1330705
1

votes
2

answer
503

Views

Setting SUID/SGID permissions to an executable

I want to show, with a concrete example, how powerful is the exploitation of a buffer overflow. To achive this goal i prepared this simple C program, called 'bo': #include #include void function(char* input) { char buffer[128]; strcpy(buffer, input); printf('Your input is: %s\n', buffer); } void m...
ilmarchese
1

votes
1

answer
322

Views

How to securly use file_put_contents()

I have a cronjob.php script which computes an array and saves it in a folder www.mywebsite.com/resoucres/array.json cronjob.php $array = array(); // A lot of code file_put_contents('array.json',json_encode($array)); When I execute the script I get the file_put_contents(array.json): failed to open...
Adam
1

votes
2

answer
83

Views

chmod - replicate user permissions to group/world

I have a need to make some folders/files (recursive) have the same permissions as that of the user. So: 0755 -> 0777 0644 -> 0666 How can I do so? Perhaps a little secret command I do know of? If there is no easy way then perhaps I would need to create a loop and test/assign. Ultimately I only need...
cyberwombat
1

votes
2

answer
82

Views

Allow different user ability to modify time of wsgi file with touch -m

I am using mod_wsgi which has the ability to dynamically reload my run.wsgi script when there's a change. My app has many files, but only run.wsgi is monitored for changes. Docs recommend to just 'touch' run.wsgi when any app files change - which does work well. The problem I'm having is that my a...
tarponjargon
1

votes
1

answer
99

Views

Phoenix file copying on Heroku

I'm trying to upload images to my Phoenix app on Heroku. I have a simple app that follows the instructions for file uploading from Phoenix's docs. I have a simple form and the controller uses File.cp_r() to copy the file from the temp directory. def create(conn, %{'user' => user_params}) do if uplo...
Mark Karavan
1

votes
1

answer
409

Views

Write an executable .sh file via fs.writeFileSync

Is there a way to write an executable shell script file using fs.writeFileSync Fundamentally i'm trying to output a .sh file via a CLI and i want that .sh file to be executable so i do not need to manually run a chmod +x 'filename' once the file gets outputted from CLI.
Sai
1

votes
1

answer
35

Views

Change root chmod privileges to r—r—r—

The question is: if I change the privileges of the chmod program from rwxr-xr-x to r—r—r—, how can I undo it? I won’t have any rights to use chmod again
Pavlo Kovalov
1

votes
5

answer
8.9k

Views

Unable to make Applications folder writeable in Mac

My Vuze cannot update itself as it claims that my application folder is not writeable. I tried to make it writeable by chmod 777 /Applications I get the following error $chmod 777 /Applications/ chmod: /Applications/: Operation not permitted How can you make /Applications folder writeable?
1

votes
1

answer
2.4k

Views

How can I audit all chmod and chgrp commands?

Corporate security policies are starting to require low level event logging. For example, file access permission changes. One solution is to use SELinux but our knowledge of this is sparse at best. Another is to replace the command with a proxy which performs auditing (this sucks though). Any ide...
Kango_V
1

votes
4

answer
278

Views

Filesystem operations don't work from my PHP script; do I need to chmod something?

I am having some permissions problems with mkdir in PHP. I am trying to simply move some files around (and create a folder to put them in), but I am getting this error: mkdir() [function.mkdir]: Permission denied in On my old site, I had my folders set to 755 and things seemed to work fine. It seems...
johnnietheblack
1

votes
2

answer
880

Views

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...
Autodidact
1

votes
2

answer
2.6k

Views

Alternative to CHMOD 777

I'm developing a WYSIWYG type site builder in JS for people who don't know HTML/CSS. It's all done, but I want to make this as simple as possible. In a perfect world, they'd just upload all the files to their host and be done with it. The problem I'm having is, I have some files and folders that...
Jordan
1

votes
1

answer
3.7k

Views

FTP User Permissions

I have a CentOS server and I want to know if it is possible to give to the ftp user permissions 'over' the Apache user? Because if I create a folder with Apache (with 755 rights), I can't remove it from ftp.
morandi3
1

votes
1

answer
3.3k

Views

CakePHP chmod question

I downloaded CakePHP and put it in my www directory. I enabled mod-rewrite and all that and changed my document root. But I still get permission denied errors in my apache error log because Cake can't require the files from other directories. It's almost as if I need to chmod every single directory...
David
1

votes
1

answer
1.2k

Views

chmod a folder on heroku app

This question might seem a little stupid. I'm new to web development and I'm just writing a simple web app to start with. I'm using flask. The app gets some images from some other sites and save them to a folder 'savedimages'. The problem is after I deploy it on heroku, I can't open any of the image...
Hieu Phan
1

votes
1

answer
446

Views

chmod with wildcard inside symlink

I'm setting up Tomcat on Centos according to https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7 , but with a twist: I put Tomcat in /opt/apache-tomcat-8.5.6 and then set up a symbolic link: sudo ln -s /opt/apache-tomcat-8.5.6 /opt/tomcat Now I change the grou...
Garret Wilson
1

votes
1

answer
48

Views

PHP : add new permission to a file

On my server I have some files with different permissions. In my php script, I want to add writing permission to the group for each of these files. Using linux cmd, chmod g+w file does the job. But how to do that using php chmod() ? This is what i tried so far: $filePermission = fileperms('myFile.t...
Hamza Abdaoui
1

votes
2

answer
1.6k

Views

What should be the chmod for the folder where a PHP script in the same folder must add files?

I developed a PHP script to add new files based on a template. I'm running it on localhost by now. I wondered what is the best chmod setting for the folder the script is in (and where the new files should go). 644 says permission denied, 622 works, 666 works (I can only choose 6, 4, 2 and 0 from the...
Agantacroxi
1

votes
2

answer
213

Views

How can I change the permissions on my pyramid/python web apps directories?

Right now my web app has this file structure on my local machine env tutorial tutorial templates home.pt static pages 1.html 2.html 3.html .... views.py __init__.py the html file under the pages directory are generated by a form. I want to make this pages directory writable, so that users can add ht...
BigBoy1337
1

votes
1

answer
1.5k

Views

git pulled files give 500 error

On a CentOS 6.3 server with WHM/cPanel: When uploading files directly, I can access them in my browser just fine, but when I git pull them from the repository, they download but I can't access them (500 Internal Server Error). I thought it was an ownership problem (on Ubuntu I used to set www-data a...
tabacitu
1

votes
1

answer
7.5k

Views

CakePHP You don't have permission to access /app/webroot/ on this server [closed]

I have a problem with CakePHP. I downloaded CakePHP and unzip framework to my project folder: ProjectCake. Then run my site(localhost): conrad.lh .The browser display: You don't have permission to access /app/webroot/ on this server. Here are my files: /etc/apache2/ste-available/default ServerName...
user1518451
1

votes
3

answer
2.4k

Views

chmod with group inheritance rights rwx for user & group only

In order to create a shared folder for a given group of users, I need restricted directory rights with inheritance. The goal is that only root and users members to the specified group can read & wright inside, by inheritating these rights for future content in my directory. Something like: drwxrws--...
ScotchAndSoda
1

votes
3

answer
3.4k

Views

permissions error running Console/cake

I'm trying to run the cake console application for the first time. From the cake app folder I am running Console/cake then I get the following output PHP Warning: SplFileInfo::openFile(/var/www/virtual_host.com/public_html/app/tmp/cache/persistent/myapp_cake_core_file_map): failed to open stream: P...
Devin Crossman
1

votes
1

answer
256

Views

Linux terminal octal form of chmod

I want to set a directory to -rwx r-x r-x using the octal form of chmod what should i type in the terminal after chmod? and how do i calculate the digits in octal form?
NewFile
1

votes
2

answer
3.8k

Views

When I set up Hadoop, what permissions are needed on the *underlying* filesystem?

To be clear, I'm not asking about setting permissions in HDFS, but rather in ext3 or whatever filesystem is being used on the individual datanode machines that HDFS is running on top of. I know that we set sudo chown hduser:hadoop /app/hadoop/tmp , so user hduser is the file owner, but I'd like to...
Joshua Fox
1

votes
1

answer
4.8k

Views

chmod android file system from script

I'm using an Android-x86 vm running in vmware fusion for some testing purposes. I am pushing files to it via adb push, however, every time I uninstall and reinstall the app, I have to execute the following: adb shell su chmod 777 /my/path exit exit I need to be able to script out this entire process...
Gregg
1

votes
1

answer
1.1k

Views

How to set output file mode permissions (rw-rw-rw-)

I've created a code that should be able to copy a file a user suggests. What I am wondering is this: how do I set the output file mode and how do I determine what the output file mode permissions will be in this code? #include #include int main() { char c; char source_file, target_file; FILE *in,...
user1021170
1

votes
1

answer
761

Views

Hive on Google Cloud wants permissions on /tmp, but no way to change permissions

I'm trying to run Hive on a Google Cloud, where Hadoop was installed by click-to-deploy. Hive seems to instal just fine, but when I run hive I get the following erroneous output: Logging initialized using configuration in jar:file:/home/michael_w_sherman_gmail_com/apache-hive-0.14.0-bin/l ib/hive-co...
Mike Sherman
1

votes
3

answer
1.1k

Views

How to improve performance of changing files and folders permissions?

I setting up my work project permissions in series to: 755 for all directories 644 for all files I do it by running next commands: $ find /path/to/project -type d -exec chmod 0755 {}; $ find /path/to/project -type f -exec chmod 0644 {}; It works fine, but a bit slowly, especially on virtual machines...
1

votes
1

answer
406

Views

Hive on Google Cloud cant access data with any user other than hive

I'm running Hive on Hadoop, and successfully installed in on Google Cloud Storage using bdutil version 1.3.1. I ran the below command: ./bdutil -e platforms/hdp/ambari_env.sh deploy As the hive user, I'm able to create / drop databases and tables without any trouble: hive> create database db_final...
Andy Crockett
1

votes
1

answer
2.6k

Views

chmod after reboot -> Permissions change

I'm working on Ubuntu 14.04 and I make chmod +x to a file, but, when I reboot the computer, the permissions change. How can I make to put chmod permanent?
PRVS
1

votes
1

answer
1.4k

Views

How to convert an input of 3 octal numbers into CHMOD permissions into Binary?

I am trying to create a program that takes input from the user using the command line of 3 octal number, for example 5, 2, 6 or 5,2,6 and convert them into 3 sets of 3 digit binary numbers, like 101 010 110, and also print out those corresponding CHMOD permissions like r-x -w- rw-. I am having a lot...
Andrew Berger
1

votes
2

answer
405

Views

On FreeBSD, why is chmod +t on a non-directory a privileged operation?

On FreeBSD, chmod +t file is a privileged operation if file is not a directory: $ echo >test $ chmod +t test chmod: test: Inappropriate file type or format $ su Password: # chmod +t test # ls -l test -rw-r--r-T 1 fuz wheel 1 Jan 26 12:44 test chmod(2) documents this behaviour: [EFTYPE]...
fuz
1

votes
1

answer
453

Views

C - chmod() not changing permissions

I am trying to change the permissions of a bunch of files that are located in a specific directory. I am using chmod to do so. The function does not return any error, but when I print the old and new permissions, it does not look like it is changing anything. void main(int argc, char *argv[]){ stru...
Eduardo Ramos
3

votes
3

answer
1.1k

Views

PHP fails to chmod?

I'm running PHP 5.3.5-1ubuntu7.2 (with safe_mode = Off) and I'm unable to correctly set the mode for any file or directory from within a PHP script, I coded the following test (just to make sure): $result = array(); if (mkdir('./I/do/not/exist/', 0777, true) === true) { $result['./I/'] = sprintf('%s...
Alix Axel
18

votes
1

answer
27.9k

Views

ADB Shell giving bad mode when executing chmod (under su)

I'm having an issue related to the Android ADB Shell. When I try to execute the command chmod he gives me a 'Bad Mode'. I don't get it why. I'm sure I'm executing under 'su', as represented by the '#'. Anyone have any idea why this is happening, and how to make it work? Thanks in advance. chmod o+rw...
Comic Sans MS Lover
1

votes
1

answer
111

Views

Preserve x flag in file mode after downloading it from a website

I put a Linux executable file on my website and I would like that, when someone downloads it on a Linux machine, it is still executable. However, when the file is downloaded it loses the x flag. Is there a solution? Despite I had a look in many places, I didn't manage to find a solution for this iss...
l3golas
1

votes
1

answer
1.9k

Views

Laravel on MAMP every time I create a new view, I have to CHMOD storage/views to 777, then 775

I am working through Shawn McCool's book (great book) and each time I create a new view, and try to load it, I get a permissions error. I am wondering why the views generated don't have read permissions. The odd thing is if I chmod to 775, I still get the error, I have to 777 then 775. Can anyone...
Jazzy

View additional questions