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.
599
questions
0
votes
1
answer
82
views
Files created by user in a mounted partition show root as owner
I have a dual boot system (Windows 10/Archlinux) and I have created a NFTS partition which is mounted at startup via /etc/fstab so I can access it from both OS'es.
The fstab file shows that the ...
1
vote
0
answers
26
views
ACL always sets group execute permissions on files (Samba)
I have some users in the "sambashare" group and some in the "sambashareAdmin" group.
Only users from the "sambashareAdmin" group are alowed to change/create stuff.
All ...
0
votes
0
answers
26
views
Linux recursive permission inheritance
I am wanting to allow file/folder permission inheritance.
On my machine, I want some directories to belong to some user/group. This is achieved by running: sudo chown my_user:my_group my_directory. A ...
5
votes
3
answers
1k
views
What's the difference between mounting a drive with rw and chmod +rw?
I know that mounting a drive with "rw" would mount the file system as read/write, but what does that even mean? What's the difference between setting read and write via chmod?
0
votes
0
answers
66
views
building .deb file using dpkg-deb, unable to set permission that I need
I have built a Python applicaton for the internal use within the company using Pyinstaller. Now I want to export it as .deb package for people to install. The file tree, excluding the source files, ...
0
votes
1
answer
45
views
Why is the sticky bit mentioned twice in chmod but only once in the ls output?
My task was to configure a directory so that users in a group could only delete files they own.
I used chmod 1771 RandD, as suggested by lab instructions, to accomplish this.
When running ls -l, the ...
0
votes
0
answers
21
views
Set group and mod of a new directory
I try to set for NEW created files/directories in /home/test:
group to "test"
right to "770"
This works for the group (1).
chown :test /home/test
chmod g+s /home/test
But I do ...
0
votes
1
answer
126
views
Cannot login normally after login loop
I recently had a login loop that kept sending me back to the login screen no matter how many times I entered the correct password. I decided to login accessing the terminal directly by pressing cntrl+...
0
votes
0
answers
37
views
Why do you need to add permission to open/run a file from terminal in linux?(chmod)
I want to open a PDF file from terminal so i used xdg-open and then it showed {File type Zip archive (application/zip) is not supported} so i looked up on google then it said to use chmod to add ...
0
votes
0
answers
23
views
chmod alternative working on ancestor paths? use case: g+x on all ancestors of a directory
There are some cases, where you might want to provide, e.g., "+x" permission to a group or others on a deep directory. It may not be overly complicated to apply this to every ancestor ...
1
vote
1
answer
33
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 ...
1
vote
2
answers
399
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:
...
0
votes
0
answers
91
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 ...
0
votes
0
answers
161
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 ...
-2
votes
3
answers
344
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 ...
0
votes
1
answer
76
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 ...
0
votes
0
answers
37
views
Sticky bit exceeds its scope of action [duplicate]
man chmod-
...
0
votes
1
answer
879
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 ...
2
votes
2
answers
454
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 ...
0
votes
2
answers
161
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 ...
0
votes
0
answers
922
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 ...
0
votes
1
answer
81
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 ...
0
votes
0
answers
28
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 ...
0
votes
1
answer
32
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 ...
0
votes
0
answers
545
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 ...
0
votes
1
answer
264
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: ...
-1
votes
1
answer
405
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, ...
1
vote
1
answer
987
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 ...
0
votes
1
answer
361
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 ...
0
votes
0
answers
65
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 ...
0
votes
0
answers
180
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 ...
1
vote
1
answer
137
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 ...
0
votes
1
answer
2k
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 ...
1
vote
2
answers
2k
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 ...
0
votes
0
answers
168
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 ...
0
votes
1
answer
59
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 ...
0
votes
0
answers
167
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 ...
1
vote
4
answers
931
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 /...
0
votes
0
answers
355
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 ...
2
votes
4
answers
896
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 ...
0
votes
1
answer
87
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 ...
0
votes
1
answer
76
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.
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 ...
1
vote
0
answers
42
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 ...
0
votes
0
answers
102
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 ...
1
vote
1
answer
2k
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 ...
0
votes
1
answer
476
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 ...
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 ...
0
votes
2
answers
285
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 ...
2
votes
2
answers
5k
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?