Questions tagged [chmod]

chmod is used to change the commonly used read, write, and execute permissions on files. It can change these permission bits for the file owner, the file's group owner, and everyone else. It can also change the more esoteric ‘permissions’ (attributes, reall) like set-user-ID, set-group-ID, and sticky bits.

Filter by
Sorted by
Tagged with
0
votes
3answers
54 views

How to force set (not subtract) permissions to future files?

I have a program on Ubuntu Linux that creates a logs/error.log file with a permissions 660 (rw-rw----) or 640 (rw-r-----). But I want the file permissions always to be 666 (rw-rw-rw-) (including when ...
0
votes
0answers
21 views

Chrome OS Crostini: Fix for 777 usr permissions

As you may know, Chrome OS is running a Linux Container (Crostini) and for my university course I needed to install Naviserver which is installed in /usr/local/ns$ My problem was that I needed to get ...
0
votes
1answer
33 views

How to copy all file attributes to another file without modifying a content?

I have file created and modified a few years ago. I would like to create new file B with different content, but same everything else, permissions, owner, group, creation date, modified date. So that ...
0
votes
2answers
36 views

Restore executable permissions to files

I mistakenly ran chmod -x * in my /home thinking I was in a subfolder (wrong terminal). Now I'm getting all kinds of errors from different applications. Is there a way for me to detect which files ...
0
votes
0answers
47 views

File Permissions keep changing back

We have a cent os7 server that recently had a new user added. It seems that during this process permissions were wrongly updated. After I have fixed the permissions to suit the site required ...
5
votes
1answer
760 views

Why am I not able to give write permission to users using chmod in linux?

The current file permissions look like this: $ ls -l file -rwxrwxr-x 1 chiranjitd chiranjitd 0 Oct 30 14:52 file Now I try to give write permissions using chmod: $ chmod +x+r+w file After that, the ...
0
votes
1answer
132 views

Can I give a single non-sudo user access to run a single command without sudo? [closed]

Is it possible to give a single user without sudo access, the ability to run a sudo protected command like chmod?
2
votes
1answer
120 views

How can I change the permission of an external hard drive and access it?

I try to access an external hard drive with an ntfs filesystem from NixOS. Is it correct that I have to create a mounting point? Where do you usually create a mounting point? sudo mkdir -p /media/b/...
-2
votes
1answer
32 views

Ubuntu - chmod g+s does not make new files inherit group

I installed a fresh ubuntu with apache2. I created a new folder "/var/www/foobar" with the following user:group -> black www-data. I need new files created inside this folder to inherit ...
2
votes
4answers
157 views

rm -rf : is there an all or nothing (atomic) approach?

Let's say I have the following structure : $ mkdir d1 $ mkdir d1/d2 $ touch d1/f1 $ touch d1/d2/f2 $ chmod u-w d1/d2 If I try to remove d1, I can't because I don't have write permissions on d1/d2. ...
0
votes
1answer
66 views

Correct permissions and ownership, still get "operation not permitted" with chmod

I'm getting "operation not permitted" even though I am in the group that owns the folder (and parent folder). [acoder@box documents]$ chmod 770 customer123/ chmod: changing permissions of '...
1
vote
1answer
41 views

Reading/Accessing a file owned by user account which is under a directory that is owned by root

I have a ssh only user account called pgbackrest with disabled password . I have created a directory /etc/pgbackrest/ as root (sudo mkdir -p /etc/pgbackrest). Then I create a config file under the ...
0
votes
1answer
94 views

chmod 070 allows all but owner of file to wrx

Directory permissions: d---rwx--- 2 root wheel - 512 Aug 5 15:43 Test/ File permsisions: ----rwx--- 1 chambi wheel - 33 Aug 5 15:42 loop.py* Both the directory and file only ...
2
votes
3answers
194 views

How to check and assign execute permission to the shell script files?

I'm looking to write a .sh script to assign execute permission to all .sh files that have not been assigned execute permission in the current directory and subdirectories. I can easily assign execute ...
-1
votes
2answers
54 views

interpreting results of ls-l

I'm having trouble interpreting the results of ls -l in my directory: -rwxrwxr-x 1 root root 37114 Jul 24 02:13 madison_events.json -rwxrwxr-x 1 root root 131355 Jul 24 16:00 ...
2
votes
2answers
236 views

Allow all users to use chmod on a NTFS file system

Issue: I have a dual-boot PC, Ubuntu / Windows 10, that share access to a NTFS disk partition (mounted as /DATA/ in Ubuntu). I need to avoid the "Permission denied" error when a chmod ...
0
votes
0answers
51 views

Why I can't open text files when execetue "x" permission is on?

for example I have test_file and I run sudo chmod 775 test_file so now while I'm the owner I can read,write and execute it but with graphical interface it doesn't work, I don't have any error messages ...
0
votes
1answer
122 views

Linux file permission confusion [duplicate]

My home folder contains 2 users. 1 admin users and 1 guest. I basically want a guest user not to be able to change the directory to a directory outside his own home folder when he logs in via SSH ...
0
votes
1answer
100 views

How can I revert the permissions of /etc? Whole system stopped working

I am looking forward for this question. How can I revert a chmod on the etc directory? I have tried all the methods, but I am still not able to restore the permissions of my /etc directory. sudo: ...
0
votes
2answers
231 views

How do I handle file names with spaces when changing permissions for certain files in the current directory and all its subdirectories?

I am currently trying to set all files with extensions .html in the current directory and all its subdirectories to be readable, writeable, and executable by their owner and only readable (not ...
0
votes
2answers
3k views

chmod to change permissions of specific user

I have two users, user1 and user2. I also have a file in /path/to/file. user1 should be able to have read-write access, while user2 should only have read access. I know that I can change permissions ...
0
votes
0answers
23 views

Starting Wso2ApimWorker - /opt/wso2/wso2am-analytics-3.2.0/bin/worker.sh: line 68: /opt/wso2/wso2am-analytics-3.2…ão negada

I have an installation of wso2am-analytics-3.2.0 that I unzipped in /opt/wso2/wso2am-analytics-3.2.0, in support of this I created the services: wso2ApimWorker.service and wso2ApimDashboard.service as ...
0
votes
0answers
5 views

Setting up admins to manage kafka cluster

I have logged in as root to my centos OS. I have setup Kafka inside the /opt directory. I have setup a group called kafka-admin to which I will then add users who can then manage the cluster ...
1
vote
1answer
170 views

chmod file permissions under home directory

I am a beginner here at unix administration. When we create a Unix user, we get a home directory for the user. Inside the home directory i.e ~/ for all the files and directories that we create, what ...
1
vote
0answers
41 views

www-data user cannot access USB drive mounted in /var/www/html/folder

I have an Raspberry Pi with mounted USB external drive. I've mounted this USB (/dev/sda1) to /var/www/html/owncloud/data/drive as I want to be able to access it from my PHP applications (precisely: ...
0
votes
3answers
141 views

Avoid deleting files in my own directory - chmod command

I want to make sure that files I have in a specific directory cannot be deleted. Which chmod should I choose to be able to reads and use the files while still not be able to delete them? I would like ...
0
votes
1answer
76 views

How to make a directory really undeletable?

I'm using this commands to make DIRECTORY undeletable: sudo chmod 000 DIRECTORY sudo chattr +i DIRECTORY But I can delete it using this commands: sudo chattr -i DIRECTORY sudo rm -rf DIRECTORY How ...
0
votes
0answers
23 views

Directory changed into a regular file upon a UI drag/drop, now how do I change it back?

I'm on Ubuntu 16.04LTS with the latest Linux kernel 4.4.0-206-generic from Canonical (which could be bugged), and I've never seen anything like this before! Somehow, simply dragging and dropping a ...
0
votes
1answer
28 views

How to affect only files who only have paths within a directory?

If i understand it correctly, in linux, a file can have an arbitrary number of paths. Suppose some user wants to change permission of their /home/<user> files so that all their files can't be ...
0
votes
0answers
40 views

`chmod g+s` returns success even though it actually fails, and only works as root

ls -l cgi-bin returns drwxr----- 3 user http 4096 Mar 16 22:35 cgi-bin. After doing chmod g+s cgi-bin, it returns success but nothing happens. What could be the cause of this? (if i try edit read/...
0
votes
1answer
4k views

What's the difference between `chmod a+x` and `chmod +x`? [duplicate]

Found an article saying to use chmod a+x to add execute permission to a file. What is the difference between it and chmod +x? (And is there an easy way to search about these differences in man pages? &...
2
votes
1answer
43 views

create hidden file to windows remote share

my user uid is 1000, windows 10 has ntfs FS, from linux executing: mount -t cifs //win-ip/share1 /home/user/remote-dir -o,username=XXX,password=XXX,uid=1000,gid=1000 I can write, read and executing ...
0
votes
1answer
546 views

Permissions of files shared via VirtualBox Shared Folders are not shown correctly in VM

I'm running VirtualBox; host and VM (guest) are both Ubuntu 20.04. I've shared the whole file system of the host (ext4) via VirtualBox Shared Folders capability for VM. I had to add my user on the VM ...
0
votes
1answer
46 views

How does one execute a script that has been piped in?

Starting with the execution context so that the problem makes sense: I am running scripts written in Windows Subsystem for Linux. In this context, scripts written can sometimes accumulate carriage ...
0
votes
2answers
68 views

find files with -perm and change perms

I need to find all files in a directory where “other” have permissions to read, write, or execute, and I need to apply those permission to “group”. Example: if file1 has rwxr--rw-, this would change ...
0
votes
0answers
29 views

Is it ok to chmod a+w files under sys/platform in a desktop env?

I developed and maintain a keyboard backlight CLI/GUI for Linux-running Clevo laptops (https://github.com/webketje/tuxedo-backlight-control). Some of the files this CLI/GUI needs to alter are under /...
0
votes
0answers
373 views

How to set correct permissions for .pem file under Ubuntu on WSL?

I'm running Ubuntu 20.04 LTS under WSL and would like to use an existing .pem file to connect via ssh to a remote system using Windows Terminal. Initially, the access rights for the file weren't ...
0
votes
1answer
378 views

Debian: Nextcloud : Can't create or write into the data directory /mnt/disk0/nextcloud-data/

I installed nexcloud on my debian install. When I run: sudo docker run -d -p 8080:80 nextcloud I get some random hash. Than I go to localhost:8080 where is set up screen. I fill up all textboxes and ...
1
vote
2answers
69 views

change permissions with find for specific files

Let's say I have a directory called permissions, that contains several files with different access rights. What I want to do is if a file has access rights for others category, I want to accord the ...
2
votes
0answers
675 views

Unable to `mkdir` in /mnt/ and cannot `chmod`

I'm following this guide on my Ubuntu Azure hosted VM and need to make a directory in /mnt/. For this question I'll just change the directory I want to create to "test". I keep getting the ...
1
vote
1answer
33 views

correct way of storing external programm and making it executable?

I downloaded the CLI Client habash for the habit/routine gameification project habatica.com. In the fandom wiki for habash it is written that, I need to set environment variables. Additonally I want ...
0
votes
0answers
34 views

setuid not allowing me to run script as root? [duplicate]

I wrote this tiny script: #!/usr/bin/env -S bash -xeuo pipefail whoami cd /repo && git fetch origin master && git merge -s recursive -X theirs origin/master And set the u+s bit which ...
0
votes
1answer
507 views

How to give write permission to apache user

I am a beginner in server management. I am using the class.upload.php library so that users can upload files from my website. To this, I give a full path like: uploads/gifs/90/x.gif This path does not ...
0
votes
1answer
159 views

chmod command to persist file permissions

This is part of Ansible automation where I have to run a single chmod command and read the permission from the users. Thus, chmod -R $fileperm <filename> However, at times the user may not ...
10
votes
1answer
2k views

Accidentally ran chmod +x /* - How bad did I just mess up?

I wanted to mark all of the files in the directory I was in as executable, and I ran chmod +x /* because I thought that was the command to mark all the files in the directory you were currently in as ...
1
vote
1answer
57 views

Allow file read only through application

I have a file with a secret and a generator application that reads it and generates something similar to a license. There are users on that Linux machine who are allow to use that application. Because ...
0
votes
3answers
142 views

chmod + x.. File fails to open [closed]

When I run the shell script on the terminal, It wouldn't work for some reason. let's say my file name is final_exam.sh, and below are my command. chmod 755 final_exam.sh sh final_exam.sh and it says ...
0
votes
0answers
33 views

Root cannot append to file in /tmp [duplicate]

As root run: cd /tmp seq 10 > foo chmod 666 foo seq 10 >> foo chown daemon foo seq 10 >> foo This gives: -bash: foo: Permission denied It is clear that it is due to /tmp's special ...
1
vote
0answers
29 views

SGID Bit prevents from changing to that directory

I have a problem which makes no sense in my mind. Could you please give me a hint what im doing wrong? I have a folder called files which has those rights: # ls -lart | grep files drwxrws---+ 19 ...
0
votes
1answer
207 views

Setting permissions on files and folder - is folder perms inheritance always implicit?

Objective: Creating a folder on the root, chown to group and add users to group - but users get too wide permissions! Consider the following: # as root # we need a user group groupadd team1 # we ...

1
2 3 4 5
11