Questions tagged [chmod]

1

votes
0

answer
379

Views

Running process 'as root' with setuid bit not working as expected - operation not permitted?

I have a program that captures network traffic off a network interface. (It's a C program sitting on libpcap.) I'm running Fedora 26. When I run the program as root, things look great: [craig ~]$ sudo su - [root ~]$ /home/craig/mybinary (output is as expected) But, when I run the program as myself (...
Craig Otis
1

votes
1

answer
4.8k

Views

How can i change permissions of a USB Stick(pendrive) in Ubuntu?

I am working on a security tool for Ubuntu in which I want to remove all permissions for a pendrive when i insert it into my system and ask for a password and then when i enter the right password then again set all permission to the device.But I don't know How can i do this(remove all permissions of...
Nitin Khanna
1

votes
0

answer
36

Views

Modifying PEM Key file permissions on non-rooted phone (EC2 won't allow publicly viewable keys)

I'm working on an app that runs many asynchronous processes on an EC2 server. Normally, I log into that server on my laptop using the Public DNS and the PEM key set in AWS. When I try to use SSH on my Android (latest version), the same credentials are rejected, likely because AWS requires PEM key f...
Kelly Reid
1

votes
0

answer
436

Views

chmod a file inside a docker container

I'm running a Roots Bedrock WordPress installation inside a Docker container that runs inside a single docker container AWS Elastic Beanstalk. This container builds using the following DockerFile FROM ubuntu:16.04 VOLUME ['/var/www/html'] # Install locales RUN apt update && apt install -y locales RU...
JoeriSmits
1

votes
0

answer
203

Views

umask OR chmod in multithreaded application

Which of these is the best practice: Set umask and create files with appropriate file permissions OR Create files and then use chmod() to set appropriate file permissions if we use umask in a thread, does it affect files created in other threads? I know chmod affects only the file, but is likely to...
MSK
1

votes
1

answer
68

Views

Vagrant VMware Desktop VM on Windows host - Folder Shares

We switched from Vagrant on VirtualBox to Vagrant on VMware Desktop/Workstation Pro because of Enterprise Licensing. The hosts are Win10, the VM will be Linux. All seems to work somehow, despite the folder sharing between host and VM. We tried many different ways, NFS, bindfs, smb, but none fit our...
Markus Köhler
1

votes
0

answer
29

Views

Changing permissions to read data/anr files programmatically

I want to read the ANR files in the /data/anr/ directory on my device. I have managed to push my apk file to the /system/priv-app/ directory, so I can list the anr files generated by that apk in my program, but I cannot read each file (there are currently 2). Their current permissions are set to '-...
Vivienne
1

votes
0

answer
31

Views

No permission to access/ tried “chmod u+x”/.command/ file kinda opens but not rally /Hairline would appreciate it

First post on here, and I'm going to make it count... I just started to learn to program yesterday and started with 'Learning Python the hard Way'. Anyways one of the first excercises instructs me open a file through my terminal (Mac). So the instructions aren't very clear (i get that it's kind of...
ramrod678
1

votes
2

answer
69

Views

How to chmod 0007 a lot of directories with php? [duplicate]

This question already has an answer here: PHP mkdir: Permission denied problem 12 answers My Website will contain thousands of subdirectories named 'e' which are to hold user created .json files specific to that directory's submission form. I need this newly created directory to be chmod 0007. How...
WerewolF
1

votes
0

answer
82

Views

ls regular expression grep line ending with 777 files

There is a little issue that makes me crazy. Let me try to explain it with a small example. I have/touch 3 files: foo.xyz bar.xyz foo.bar I change the mode to 777 of foo.xyz (chmod 777 foo.xyz), the other remains 640. Now I want to use ls to list all the files and use grep to search for a specific...
PaGla
1

votes
0

answer
48

Views

ssh key authenticated user unable to use apt-get update

Ubuntu Linux 16.04.5 I have configured a server for SSH Keys Authentication With PuTTY. Key authentication works fine for the user account accessing the server, the problem is that when attempting to utilize 'apt-get update' the system returns: [email protected]:~$ apt-get update Reading package li...
Carlsbad Raceway
1

votes
2

answer
82

Views

Change permissions access denied brew link imagemagick

Imagemagick was improperly installed on my computer. I have homebrew and when trying to link I encountered the same problems listed in this post Caseys-MacBook-Pro:~ CaseyJayne$ brew link imagemagick Linking /usr/local/Cellar/imagemagick/7.0.8-13... Error: Could not symlink etc/ImageMagick-7/color...
Casey Jayne
1

votes
1

answer
655

Views

Why are my file permissions on Apache being reset?

We recently switched from using PCs at work to Macs, so I'm new to the *nix way of doing things. I have the default Apache running that shipped with 10.5, but I've noticed that when I drag files from a Windows server to my machine, the permissions are changed. Specifically, I'm writing data to an XM...
Nathan Peretic
1

votes
6

answer
3k

Views

PHP: Setting permissions so I can write a file?

I am trying to create a file with PHP here is my code: $file_to_send = 'ftp_test_from_created_file.txt'; chmod($file_to_send, 0777); $fh = fopen($file_to_send,'w'); $tsv_line = 'Hey\tThese\tAre\tTab\tSeperated\tValues'; fwrite($fh, $tsv_line); fwrite($fh, '\n'); $tsv_line = 'Hey\tThese\tAre\tToo'; f...
JD Isaacks
1

votes
1

answer
133

Views

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 e...
user377370
1

votes
1

answer
1.1k

Views

LAMP web server file permissions

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 .ht...
jchen123
1

votes
1

answer
5.3k

Views

smarty template compile directory not writable

i'm using the latest version of smarty (3.0rc3). i made my templates_c directory writable in command line (chmod -R 777 templates_c) but smarty still outputs this when i call $smart->utility->testInstall(); Testing compile directory... FAILED: ./php/classes/smarty/templates_c/ is not writable. Warn...
kossibox
1

votes
1

answer
68

Views

How to disallow creation of new files in folderX?

In a folder say /folderX/ there are 4 .txt files. A php script currently makes new files if unexistend, based on the site.org/foo/ of the url it updates a new file if foo.txt does not exist, then it will go ahead and create it. But I would wish to: A) If the existing file is already in the folder, t...
Sam
1

votes
2

answer
218

Views

How to upload a site to a server where folders are writable for php

This problem occurred to me multiple times now, and it's time for me to do it the right way! How can I upload a website to the server, where php has access to the folders for writing data. Usually I use an FTP program, but I can't upload as root, so there are restriction problems all over the place....
Tim Baas
1

votes
3

answer
410

Views

Need Help Setting Chmod Permissions on New Directory via PHP

I am using PHP's mkdir function and I am having some difficulty with the $mode parameters. If I don't specify a parameter, I get UNIX 755 as the default permission settings of the new directory. I would like to set the permission to be UNIX 777, so I did that as you see here: $mode = '0700'; mkdir...
Presto
1

votes
4

answer
272

Views

PHP Upload Script not Functioning Properly with New Host

I have set up a php script which creates a directory and uploads a file to that directory. My issue is that when I use the script to create the directory, the file will not upload entirely. I ran the exact same script on a different host and the upload process works just fine. Plus, if I manually...
Presto
1

votes
1

answer
1.9k

Views

Git CHMOD post-receive hook

I'm using a bare remote repository on my webserver with a post-receive hook that will automatically push my files in the public_html directory. The problem is, I'm using codeigniter and the index.php file has to be chmod 755. I changed it on the server with filezilla, but after every push the index....
24creative
1

votes
2

answer
67

Views

upload / download permissions

I currently have a folder which the public uploads files to. I want to be able to download these files via a link, but not to be able to browse the upload folder. But at the same time, i need to keep that folder writable for uploads. What permissions would I need to set? Cheers, Doug
cardi777
1

votes
2

answer
748

Views

ftp_site() doesn't want to change CHMOD on the folders

I have a joomla page on which I want to install a few extensions. However due to the chmod permissions I am unable to upload and install the packages. Following the guide here I can see that in order for the plugins to be installed there are too many folders which permissions have to be changed. For...
Spirit
1

votes
1

answer
639

Views

Executing binary files with a shebang

I created a simple program that takes the path of a directory as an input, creates an archive of that directory (converting it into a single file), adds a shebang to that file (so that the contents of the file can be easily extracted), and writes the file to the base directory of the specified path....
Aadit M Shah
1

votes
1

answer
1.9k

Views

Ruby FileUtils.chmod in Windows

So I have a Ruby script where I am moving files around and whatnot and, at a point in it, I need to set the permissions for some files so that when viewed from a UNIX machine, the permissions are being reflected accurately. The problem is, I am running the script from a Windows 64-bit machine and it...
Andrew Backes
1

votes
1

answer
1.4k

Views

How to change remote file permission via FTPClient

I need to handle remote file on a ftp server via commons-net-1.4.1.jar,class org.apache.commons.net.ftp.FTPClient.It's seems that no api available to change a file's permission,just like unix shell command chmod. Anyone know any solution to resolve this issue?
mojiayi
1

votes
1

answer
1.2k

Views

local and NIS user with the same name - chown

I have a linux with a configured NIS domain, and both a local user and a NIS user with the name johndoe (but different UIDs). When applying 'chown johndoe:johndoegrp somefile.txt' - which john doe will become the owner ? I know I can see for myself with 'ls -n', but some end users told me that they...
Nati
1

votes
1

answer
1.7k

Views

In some Host 755 is writable folder and in some its not ? What are the changes once should make to make 755 writable

In some Host 755 is writable folder and in some its not ? What are the changes once should make to make 755 writable. Is that User Issue to whom the file is served ? For an Instance, If file is served to user: matt and to make the file writable by apache, does it needs to be owned by apache ? or som...
UserHex
1

votes
1

answer
196

Views

Using Sys.chmod to toggle world-readability in R

How can I use the Sys.chmod function in R to toggle readability by 'other', i.e. the equivalent of: chmod o+r myfile chmod o-r myfile I specifically want to leave the other parts of the mode alone.
Jeroen
1

votes
1

answer
158

Views

Is_writeable fails but I am the owner

I have the below code running and will give the CHMOD and CHOWN values below. But for some reason is_writable keeps failing. if (!is_writeable($this->path)) { echo 'Current script owner: ' . get_current_user(); echo ''; echo $this->path; echo ''; print_r(posix_getpwuid(fileowner($this->path))); } Th...
Somk
1

votes
1

answer
70

Views

Allowing single group having access permission of multiple groups

I would like to know one thing about linux (ubuntu) permission commands. I am having couple of user groups in my linux environment 1) www-data -> Created by nginx automatically 2) ubuntu -> Just for PHP uses Now both are having their own different writing permissions .. I would like to merge them bo...
Tom Inic
1

votes
1

answer
601

Views

Add write permission and keep gid

Here is the setup: I have a user called git with a umask of 022. git adds files and folders into a folder called htdocs. htdocs has drwxr-srx permissions (gid set) and is owned by git:apache Created files and folders in htdocs have -rw-r--r-- (644) and drwxr-srx (2775) Sometimes I need to give Apach...
NightHawk
1

votes
2

answer
3k

Views

linux how to allow user to read/write/delete files created from root in a specific folder

I use automysqlbackup to backup my mysql database. The problem is I can only run this program using sudo automysqlbackup. This program dumps the backup into my folder /home/user/backup but theses files are owned by root and when I connect via ftp to this folder I cannot delete or read them. Is it p...
Tamere Jlanik
1

votes
1

answer
553

Views

maven-war-plugin chmod exit code was:127

I am running a shell to call a ant, which further call a maven in Redhat. Could anyone point out the context of this error? [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:wa r (default-war) on project sites: Error unpacking file [/scratch/mingtzha/12.1/.../sites-dojo/ta...
Mingtao Zhang
1

votes
1

answer
1.5k

Views

Set chmod 0666 manually

I have this code if (!is_writable(ABSPATH . '/_config.php')) { if (!chmod(ABSPATH . '/_config.php', 0666)) { return 'Cannot change permissions of config.php You must do it manually: set chmod 0666 for file system/_config.php'; }; } Now i have to set chmod 0666 for _config.php manually. How? I trie...
Andreas
1

votes
1

answer
881

Views

chmod not changing file permissions

When I try to change the permissions for a file it doesn't seem to work. chmod says it is changing it but the file permissions remain the same. Can anyone explain what I am doing wrong? Here is a copy of my command line. ~$ sudo chmod -v u+x ex01 mode of 'ex01' changed from 0600 (rw-------) to 0700...
TerekC
1

votes
1

answer
330

Views

Assigning chmod permissions and excluding a file in a Unix Shell Script

I am trying to write a shell script that allows a user to enter a permission, a directory name, and a file to exclude using the chmod command. I can't seem to get it to work correctly. I am very new to shell scripting, so it may be a simple syntax error. My code is shown below: #!/bin/bash clear ech...
austinsk8s
1

votes
1

answer
284

Views

phpspec in vagrant vm - permissions error

I am setting up a new Laravel project and wishing to use PHPSpec within the project. I can run PHPSPec from my local OSX machine, but I want to be able to run it from within the VM. I get 'command not found' or 'Permission denied' errors when running from within the Vagrant VM (Ubuntu 12 currently)...
Adamski
1

votes
1

answer
134

Views

Git unable to update clean working directory

I have Git setup on my machine, and it's been doing something strange. I'll start from scratch. [nighthawk]$ cd ~ [nighthawk]$ rm -rf ./www [nighthawk]$ ls Maildir logs [nighthawk]$ Now I will clone the repository. [nighthawk]$ git clone https://key:@github.com/user/repo.git ./www Cloning into ./w...
Jonn

View additional questions