Skip to main content

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 votes
3 answers
80 views

Do we need to memorize every command of Linux OS Terminal Shell? [closed]

This is a rare question that I can ask from the experts that every time I use a command for the Linux OS Terminal Shell. Do I need to memorize every command in the Command Line Interface (CLI) of ...
Bhavneet's user avatar
0 votes
3 answers
52 views

What security advantage does executing privileges have?

Say some sysadmin has no problem with their users reading the files in /sbin, but doesn't want them running them. Take for example /sbin/initOne rebellious user used ld.so /sbin/poweroff instead. ...
rando's user avatar
  • 125
0 votes
1 answer
27 views

Equivalent of dpkg-statoverride for RPM-based distros

If you just chmod a file installed by a package (e.g., chmod 4750 /usr/bin/foo), future updates to the package can wipe out your change. On deb-based distros like Debian and Ubuntu, dpkg-statoverride ...
Joseph Sible-Reinstate Monica's user avatar
0 votes
1 answer
49 views

Have drwxrwxrwx permissions on folder, but after mounting to it it becomes drwxr-xr-x which disalows members of the group to write. How do I fix it?

I have a folder under /mnt/ with drwxrwxrwx permissions and under root:root I then mount a USB drive (exFAT) to this folder and it becomes drwxr-xr-x The issue is that now I cannot scp to that folder ...
Duxa's user avatar
  • 103
0 votes
0 answers
23 views

Sticky bit on directory seems to prevent modification of files in it. Peculiarity of the distro or norm? [duplicate]

Recently I've noted I cannot edit file owned by another account in /tmp as ordinary user account. By trial and error seems it is due to sticky bit on /tmp. But man page of chmod and https://en....
Martian2020's user avatar
  • 1,219
0 votes
2 answers
111 views

Lost sudo. Beyond salvation?

I made a mistake and gave a container Homepage access to the docker.sock and briefly after I discovered that sudo is no more. sudo sudo: /etc/sudo.conf is owned by uid 1000, should be 0 sudo: /etc/...
Arelius's user avatar
  • 73
0 votes
3 answers
65 views

Keeping owners in a folder copy

I'm trying to copy a folder (SRC) containing some files and subfolders. The content and SRC itself have setgid bit enabled (that is the s in place of the x in the group triplet). Furthermore, the ...
user9952796's user avatar
0 votes
1 answer
56 views

How can I grant read permission for HTTPS certificates?

I'm enabling Gitea HTTPS access. On my server I got certificates using Certbot. The certificates are installed into: Certificate Path: /etc/letsencrypt/live/mydomain/fullchain.pem Private Key Path: /...
Mark's user avatar
  • 733
5 votes
1 answer
499 views

Root couldn't write to file with rw permissions for all users and owned by other user

I have script that can be runned from different users on the same machine. This script should write logs to the same file on every run. Minimal version of script: #!/usr/bin/env bash ...
armoken's user avatar
  • 53
0 votes
1 answer
19 views

/etc/samba/smb.conf: With what command's logical approach the octal values are based?: chmod or umask?

About Samba I am reading the following valuable tutorial: How to Set Up a Network Shared Folder on Ubuntu With Samba At the Step 2: Configuring Samba section appears the following configuration [...
Manuel Jordan's user avatar
0 votes
1 answer
144 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 ...
JulioOAO's user avatar
1 vote
0 answers
38 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 ...
MrGlasspoole's user avatar
0 votes
0 answers
42 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 ...
clank's user avatar
  • 1
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?
Noobman's user avatar
  • 63
0 votes
0 answers
200 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, ...
Jokubas11's user avatar
0 votes
1 answer
52 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 ...
user avatar
0 votes
0 answers
23 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 ...
chris01's user avatar
  • 615
0 votes
1 answer
228 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+...
Ash's user avatar
  • 145
0 votes
0 answers
38 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 ...
nanda's user avatar
  • 1
0 votes
0 answers
34 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 ...
AlexK973's user avatar
  • 151
1 vote
1 answer
34 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,428
1 vote
2 answers
694 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
102 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
184 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
487 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
  • 395
0 votes
1 answer
85 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
1 answer
1k 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
3 votes
2 answers
627 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
  • 33
0 votes
2 answers
199 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
998 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
99 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
  • 111
0 votes
1 answer
35 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
  • 253
0 votes
0 answers
783 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
1 vote
1 answer
369 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: ...
Navdeep Singh's user avatar
-1 votes
1 answer
562 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
  • 7,162
1 vote
1 answer
1k 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
483 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
81 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
219 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
151 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 ...
greenbug's user avatar
0 votes
1 answer
3k 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
2 votes
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 ...
jyoung's user avatar
  • 111
0 votes
0 answers
188 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
67 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
217 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
1k 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
369 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
1k 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
101 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
80 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
2 3 4 5
13