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
1 answer
47 views

Using "chmod -R 666 filename" does not give all files writing permissions

I have been running as root in a Linux Virtual Machine to change permissions to a whole list of files within a directory. When I check the permissions after using sudo chmod 666 -R /home/candidate/...
user avatar
0 votes
1 answer
25 views

Do group permissions matter for files owned by the root group?

I've stumbled upon a script which included the following two commands: chown -R some-user:0 /some/dir chmod -R g+w /some/dir Specifically, this is from the Dockerfile of the nginx-unprivileged Docker ...
user avatar
  • 195
-4 votes
1 answer
68 views

What permissions are needed to prevent a group from writing to or deleting a file?

myfile permissions: group has rwx mydir permissions: group has rwx Problem: user1 wants to prevent group members from writing to myfile or deleting myfile What chmod options are needed to achieve ...
user avatar
0 votes
0 answers
33 views

give access to /home/$USER/targetfolder only to me and a partner

I'm working on a server where current users (group=domainusers gid=1002) can read, write and run ONLY our own files. Because of my kind of permissions I'm not able to run apt | adduser | addgroup | ...
user avatar
  • 48
1 vote
2 answers
80 views

Why I can't set the setuid for "others"?

I can't set other's setuid bit. Why? Is there some security lock? $ ls -l -rwxrwxr-x 1 allexj allexj 16784 Mar 11 17:30 a....
user avatar
  • 221
4 votes
1 answer
62 views

How to create a directory, where users can delete only their own files, but one user can delete anyone's files?

Consider the following setup: # two users in groups sales useradd edwin useradd santos groupadd sales usermod -aG sales edwin usermod -aG sales santos # two users in group account useradd serene ...
user avatar
  • 460
-2 votes
3 answers
117 views

Lost permission to all my files

chmod 700 /home/$user chmod 700 /boot /usr/src /lib/modules /usr/lib/modules I ran these commands and lost access to folders and files. Can anybody help me regain access please?
user avatar
  • 1
1 vote
0 answers
28 views

Create a folder which can be written to but not read

I've been going over content I previously used in Uni to learn Linux, as I have gotten rusty and thought a refresher would be helpful. The content is hosted on a site similiar to Hack the Box which is ...
user avatar
0 votes
0 answers
34 views

permanent `chmod` of btrfs top-level directory

When doing chmod o+rx /mnt to a btrfs filesystem, the chmod changes are lost after reboot. How can I permanently give o+rx access to a btrfs top-level directory?
user avatar
2 votes
0 answers
18 views

Permission when setting up sftp on Ubuntu

Okay, so I'm setting up an sftp server on Ubuntu 20.04. There will be multiple users accessing the box through sftp and I want each one of them to only have access to their own directory. I don't want ...
user avatar
  • 433
1 vote
0 answers
261 views

Why can't I create a file in a directory with permissions 777?

I've got a directory on an Android device that I've set to permission 777. But as a non-root user while I can touch existing files with these permissions, I can't create new files. $ ls -la total 0 ...
user avatar
  • 474
-1 votes
1 answer
41 views

Please help with applications folder

I wanted to have full permissions on my applications folder, but I used chmod incorrectly, and accidentally made the application folder only accessible to root. I don’t have read or write privileges ...
user avatar
0 votes
1 answer
210 views

chmod for all folders created by specific user

Say I have the following folder structure folder/ ├─ subfodler_2/ #User1 ├─ subfolder_3/ #User2 ├─ subfolder_1/ #User1 where I want to chmod all the folders (and files) created by User1 ...
user avatar
0 votes
1 answer
2k views

Podman errors on tar with potentially insufficient UIDs or GIDs available in user namespace

When I run podman run I'm getting a particularly weird error, ❯ podman run -ti --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest ✔ docker.io/rancher/rancher:latest Trying to pull ...
user avatar
  • 22.9k
0 votes
1 answer
107 views

.desktop File not Working Properly

I'm trying to create a .desktop file for a python script (for the Electrum Bitcoin wallet). If I navigate to the folder where the file is saved and run it (python3 /home/username/.local/bin/electrum), ...
user avatar
0 votes
3 answers
58 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 ...
user avatar
  • 105
0 votes
0 answers
47 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 ...
user avatar
0 votes
1 answer
133 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 ...
user avatar
  • 141
0 votes
2 answers
64 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 ...
user avatar
0 votes
0 answers
98 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 ...
user avatar
  • 103
5 votes
1 answer
910 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 ...
user avatar
1 vote
1 answer
1k 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?
user avatar
  • 147
2 votes
1 answer
488 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/...
user avatar
  • 81
-2 votes
1 answer
165 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 ...
user avatar
  • 1,720
2 votes
4 answers
176 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. ...
user avatar
  • 1,030
0 votes
1 answer
316 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 '...
user avatar
  • 2,944
1 vote
1 answer
45 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 ...
user avatar
  • 135
0 votes
1 answer
236 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 ...
user avatar
  • 3
2 votes
3 answers
807 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 ...
user avatar
-1 votes
2 answers
62 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 ...
user avatar
2 votes
2 answers
490 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 ...
user avatar
0 votes
0 answers
66 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 ...
user avatar
  • 181
0 votes
1 answer
184 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 ...
user avatar
0 votes
1 answer
196 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: ...
user avatar
0 votes
2 answers
449 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 ...
user avatar
0 votes
2 answers
7k 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 ...
user avatar
  • 135
1 vote
1 answer
247 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 ...
user avatar
  • 135
1 vote
0 answers
135 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: ...
user avatar
0 votes
3 answers
427 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 ...
user avatar
0 votes
1 answer
126 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 ...
user avatar
  • 63
0 votes
0 answers
24 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 ...
user avatar
0 votes
1 answer
33 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 ...
user avatar
0 votes
0 answers
108 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/...
user avatar
2 votes
1 answer
10k 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? &...
user avatar
2 votes
1 answer
56 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 ...
user avatar
  • 1,839
0 votes
1 answer
912 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 ...
user avatar
  • 103
0 votes
1 answer
52 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 ...
user avatar
  • 653
0 votes
2 answers
124 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 ...
user avatar
  • 3
0 votes
0 answers
37 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 /...
user avatar
  • 101
0 votes
0 answers
583 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 ...
user avatar

1
2 3 4 5
11