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
1 vote
1 answer
28 views

Is there a standard way of making a copy of file/folder permissions to apply/compare later?

I'm copying a bunch of files to a filesystem that doesn't support permissions. however, I will need to copy them to another filesystem which does support permissions a few years from now. at that ...
Behrooz's user avatar
  • 2,278
1 vote
2 answers
91 views

chmod command output: cannot access '/root/server/app.sock': No such file or directory while file exists

I run the command sudo chmod 777 ~/server/app.sock on my server and it works appropriately and changes the permission. However, when I run this command through github action, it doesn't work and says: ...
hermi's user avatar
  • 11
0 votes
0 answers
52 views

Tried accesing my custom shared object, but permission is denied

Created a basic C++ shared objects file using g++: // calculate.hpp #ifdef __cplusplus extern "C" { #endif // typedef struct ...; // function decls int Add(int x, int y); #ifdef ...
enrico sebastian's user avatar
0 votes
0 answers
69 views

Linux Ubuntu 20.04 - ownership changed to root for entire drive - permission changed to 777 for all files, cannot revert

I am running Linux Ubuntu 20.04 and for some reason unknown to me, one of my storage drives suddenly has changed ownership to root and all file permisions are read/write/execute for all users. A ...
UsernameError's user avatar
-2 votes
3 answers
123 views

What is the value for rwSrwSrwT?

The value 1777 is the permission of rwxrwxrwt: touch target.txt chmod 1777 target.txt ls -al target.txt -rwxrwxrwt 1 debian debian 0 Jul 14 20:24 target.txt I have to get a permission string of ...
showkey's user avatar
  • 99
0 votes
1 answer
44 views

Why is chmod working inconsistently between files?

I am making 3 sites in Drupal and need to frequently change the settings.php file in each website folder. This file is read-only for security reasons by default, so before I can edit it, I use: chmod ...
GeorgeCiesinski's user avatar
0 votes
0 answers
37 views

Sticky bit exceeds its scope of action [duplicate]

man chmod- ...
achille's user avatar
  • 103
0 votes
1 answer
164 views

How can I grant a user group permission to start/stop a custom service?

I have a service that exists in the root directory and I want to give user group admin permissions to run the service. The service exists in /root/home/custom_service/service.service I tried chgrp ...
jo.oj's user avatar
  • 3
2 votes
2 answers
181 views

Not able to give write permission to other user with ACL or chmod

Anyone know why rocky can't write to /tmp/afile? Giving rocky permission as an other user with chmod o+w doesn't seem to work either 🤔 I updated the acl with: setfacl -m u:rocky:rw /tmp/afile id as ...
Newbie's user avatar
  • 23
0 votes
2 answers
101 views

Why is an open inode system call a security risk?

According to the accepted answer here, it is simply because you would not make the access checks at the directories leading up to that file. For example, with a call to openinode(inode #, flags). My ...
user129393192's user avatar
0 votes
0 answers
658 views

Nginx Permission denied

I am using Nginx to serve static files from server. Static file is located in root folder, /server/cdn. I give all permission to this folder with sudo chmod 777 -R server command. Also I changed the ...
Alok Prakash's user avatar
0 votes
1 answer
47 views

chmod not working on NTFS-3g partition

I have a file on an NTFS-3g partition, I tried using chmod to add execute to this file, but it remained unchanged. What am I doing wrong? I followed this and this posts, but none of them worked, this ...
michaelbr's user avatar
0 votes
0 answers
20 views

Cannot open files in texlive directory

I've installed texlive 2023 via tlmgr, the directory is /usr/local/texlive/2023/ and update it with sudo tlmgr --self --all --no-auto-remove update as I've been doing it for years. It works perfectly ...
Alexander Wittmann's user avatar
0 votes
1 answer
26 views

Does Linux clear set-group-ID bit for a file is the group ID of the file doesn't match?

I was going through the amazing book The Linux Programming Interface. In that chapter 15, section 15.4 page no 304, it is written that: For this reason, when an unprivileged process (one that doesn't ...
arka's user avatar
  • 193
0 votes
0 answers
35 views

What File Permissions to use for Docker Owned Files

So ive got a ubuntu server install with docker thats running a few containers and ive got folders for each now im wondering what would the logical permissions be for the files it cant be 777 right? it ...
IThundxr's user avatar
0 votes
0 answers
289 views

rsync permission denied - but they have full 777?

It is getting late and I am loosing my mind ... I have a data drive (NTFS) which I used to share in an Windows/Ubuntu dual boot system. After an upgrade it is currently Windows 10 and Ubuntu running ...
territrades's user avatar
0 votes
1 answer
85 views

Why does adding a user and setting an SUID for it throws me the "Operation not permitted" error?

I am setting SUID for a new user tommy to run the same commands as root but it goes down like this: [root@192 ~]# useradd tommy [root@192 ~]# su - tommy [tommy@192 ~]$ chmod u+s /usr/bin/ls chmod: ...
sengh's user avatar
  • 1
-1 votes
1 answer
211 views

preventing linux user from chmod 777

With /etc/login.defs having UMASK 007 or UMASK 027 for example will result in created files not having world rwx permissions. But a user can chmod 777 file they own correct? Also for home accounts, ...
ron's user avatar
  • 5,816
0 votes
0 answers
26 views

Access rights through group which limits modifying/deleting others files

(I previously posted this on superuser, but thinks this question is a better fit for this stackexchange...) Let's say I have a directory some_dir, and a group some_group with a number of users. I ...
Bart's user avatar
  • 900
1 vote
1 answer
440 views

Allow user in group to access shared folder from another user

There are two accounts user1 and user2. I wish to share and give rwx access to my user1 /home/user1/Documents/ folder with user2. To do this, I have made a new group called sharedDocs. These are the ...
0xheartcode's user avatar
0 votes
1 answer
147 views

Is it possible to revoke delete permissions with Linux permissions or ACL's?

If i wanted to create a directory that is owned by a user don and the group owner was a group called bob, would there be any way to: Allow the group (bob) to have permissions to create and write to ...
zeek's user avatar
  • 1
0 votes
0 answers
41 views

macOS ACL settings - unable to delete Time Machine backup left-over files

(macOS Ventura - MacBook Pro M1) I have deleted Time Machine backup file manually!! (my bad). Now I am left with files in my .Trashes folder that I cannot delete, no matter what I try. I have enabled ...
cem ozel's user avatar
0 votes
0 answers
267 views

Force certain file permissions on files uploaded to SFTP server

I have the openssh sftp server set up to force sftp for users in the sftp group. Additionally, they are chrooted into the /srv/users/%u directory. This works fine, and users can access the directory, ...
Matthias Lee's user avatar
0 votes
0 answers
147 views

change a folder permission in root directory

I want to change a folder permission in root directory ( /backup like /home) when I tried chmod 755 /backup it changes for a day and after a day its permission changes back. how can I change it ...
behrooz's user avatar
1 vote
1 answer
95 views

Unable to see thumb drive through file manager

I am using EndeavorOS with i3 and am trying to put stuff on a thumb drive, but Thunar file manager isn't seeing it. When I run fdisk -l and lsusb I see the thumb drive, but it doesn't show up in ...
Hercislife's user avatar
0 votes
1 answer
828 views

Does "chmod u+w" mean give the user (owner) writing permissions ("2XY" in octal)?

I understand that chmod u+w means give the user/owner (u), writing permissions (w, which is equivalent to the number 2), so the new permissions of the file after running the chmod command above would ...
alfred's user avatar
  • 7
0 votes
0 answers
22 views

What does chmod u+w mean and is there a longer but clearer command? [duplicate]

Say I run for example, chmod u+w web/sites/default. What does chmod u+w mean and is there a longer but clearer command? I understand from man chmod that u here means user (owner), but what is w here? ...
alfred's user avatar
  • 7
1 vote
2 answers
716 views

marking the contents of a directory read-only

I'd like to mark a directory as read only in a way that would make it's contents read-only. Using chmod a=rx makes the directory read/executable only, so it and its contents can't be deleted. That's ...
jyoung's user avatar
  • 51
0 votes
0 answers
142 views

No write permissions for bootable usb

Background: I'm installing Windows for the DOS laptop for the first time, I've never done it before. There is a second laptop with Ubuntu 16. I downloaded the image from the official site, created a ...
Любовь Пономарева's user avatar
0 votes
1 answer
48 views

Do I need to reformat my drive?

Learning the hard way that you can't change the permissions of an exfat volume.... I need to be able to scp from Windows to an external hard drive on my Ubuntu Server without using an intermediary ...
Ego's user avatar
  • 3
0 votes
0 answers
114 views

Can you make a proxy file system?

Is it possible on Linux to create a proxy file system? So the idea is to have all the file operations done on one file system, but to have all the contents saved on another file system. The problem I ...
Hielke Walinga's user avatar
1 vote
4 answers
590 views

How can I revert a chmod -R +x on the etc directory?

I'm running Ubuntu 20.04.5 LTS and I messed up with the chmod -R command! I mistyped the directory while running chmod and instead of chmod -R +x ./etc I wrote chmod -R +x /etc. So now everything in /...
MatthewJ's user avatar
0 votes
0 answers
152 views

read write file permission in linux

I have Ubuntu WSL with default username wsl and new user with username newuser List all files : wsl@Optiplex:~$ ls -la total 176 drwxr-xr-x 13 wsl wsl 4096 Nov 1 06:36 . drwxr-xr-x 4 root root ...
Anas Fanani's user avatar
0 votes
0 answers
312 views

sudo not working after chmod -R 777 /bin at wrong location

By mistake i executed below command [root@ip-172-31-71-252 ~]# chmod -R 777 /bin and location was [root@ip-172-31-71-252 ~]# pwd /root Then I logged out of from root session and tried 'sudo -i' I am ...
Amit Sharma's user avatar
2 votes
4 answers
528 views

How to allow users of a group to have the same permission of the owner?

I'm not a linux expert and I would like to know how can I fix this situation: there is an user called demo which have as id 1000, this user is associated to www-data group, so the demo user can ...
sfarzoso's user avatar
  • 123
0 votes
1 answer
62 views

How do I have two group owners

I have a file where I want there to be not one but two groups who can have extra privileges to access it. But when I chown or chgrp it to a group it always erases the previous group. How do I add a ...
ConcernedParagraph7235's user avatar
0 votes
1 answer
71 views

I accidentally disabled execution of all files on my OS

sudo chmod -333 / The system expectedly doesn't work. I'm wondering if there are any ways to get it back up besides reinstallation? My operating system is Debian.
Trashbin2019np's user avatar
1 vote
1 answer
3k views

Can't change mounted HDD's permissions at all

I'm new to Ubuntu. I installed Ubuntu on my PC which has SSD and HDD. I followed the guide to partition HDD properly and it has been mounting without errors so far. However, I can't write anything in ...
Dushamishkin's user avatar
1 vote
0 answers
39 views

Permission Error

I have installed bash shell in windows 10 to run linux commands. I am trying to execute a script which gives error "You do not have permission to edit". I have executed command "chmod ...
harpreet's user avatar
0 votes
0 answers
87 views

Best way to source config file inside sudo user .bashrc file?

I'm building a LEMP stack script powered by bash scripts and CLI aliases. For security reasons, all of the bash scripts, and the stack config file (also bash syntax) are owned by root:root. I added ...
Jesse Nickles's user avatar
1 vote
1 answer
1k views

Is there ever a good reason to add users to the "root" group?

There is much discussion online about creating sudo users and groups, editing the sudoers file, etc. For example, you might have sensitive configuration files or shell scripts, and you set the file ...
Jesse Nickles's user avatar
0 votes
1 answer
273 views

How to restrict read access to directory for specific user in centos?

So here is the deal, I create directory /home/accounting, I have users donna and mike and I want to restrict read privileges for them to this directory. After going to Google I was able to find how to ...
Sydnel's user avatar
  • 1
0 votes
0 answers
19 views

chmod adding only write permission for user [duplicate]

I am new to linux. I learnt about chmod command, and was trying to do some practice. There is a file named "a". Initially this file has no permissions for user, group, and other user. I ...
Baazigar's user avatar
0 votes
2 answers
168 views

How to make a folder can't be deleted and be modified folder name. But you can still add files in it?

I want to make a shared disk with people online using ubuntu VPS. So as the title says, I want to make a folder can't be deleted and be modified folder name. But you can still add files in it (it's ...
peilin's user avatar
  • 1
1 vote
2 answers
3k views

What is the meaning of chmod -R a-x,a=rX,u+w?

What is the meaning of chmod -R a-x,a=rX,u+w? chmod changes file permissions, -R makes it be done recursively but what are: a-x a=rX u+w here?
kature's user avatar
  • 23
0 votes
1 answer
528 views

SFTP Only Users Unable to Delete/Edit Files They Create

I modified /etc/ssh/sshd_config with these lines to support an sftp user group that isn't able to SSH. Subsystem sftp internal-sftp -l VERBOSE Match Group sftpusers X11Forwarding no ...
user534166's user avatar
0 votes
1 answer
695 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/...
Larry Hewl's user avatar
0 votes
1 answer
85 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 ...
JMC's user avatar
  • 195
-4 votes
1 answer
394 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 ...
simranjit kaur's user avatar
0 votes
0 answers
38 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 | ...
ser356's user avatar
  • 58

1
2 3 4 5
12