Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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.

-2
votes
0answers
19 views

USER PERMISSION IN kali [duplicate]

Can anyone tell me what permission are necessary for a file so that it can be deleted by another user of same group?
1
vote
1answer
25 views

stop force save on a file with read only permission

I have a script file that is currently in sudoers, and for security I want this file to be read only... so I issued the following chmod: chmod 555 test.sh Now the permissions on this file are -r-xr-...
0
votes
1answer
43 views

Website cannot write to files or create directories

I've been trying to install TeemIP for about 6+ months now and I've never been able to figure out this issue on Centos7. The error I get is the following: The directory '/var/www/teemip/public_html/...
19
votes
2answers
689 views

What does chmod -u do?

By accident I ran chmod -u filename and it removed all of the permissions I had on filename. The man page does not reference a -u option. Experimenting I was able to conclude that it removes not all ...
1
vote
0answers
41 views

Does Access Control lists override group or owner permissions?

I came across the following task: Add 3 new users - alice, bob, charles Create a new group - marketing - and add alice, bob and charles to that group Create a directory - /marketing - whose owner ...
6
votes
2answers
506 views

Can't remove a file with file mode bits a+rw

I have a file with the following file mode bits (a+rw): [0] mypc<johndoe>:~>sudo touch /tmp/test [0] mypc<johndoe>:~>sudo chmod a+rw /tmp/test [0] mypc<johndoe>:~>ls -l ...
1
vote
1answer
39 views

chmod without changing stat (atime) of file

i would like to be able to chmod a directory structure without changing the atime of those (files and) directories. if i start out with a file structure like $ tree test/ test/ ├── test1.txt └── ...
1
vote
1answer
51 views

Can only write as root although user seems to have full permissions [duplicate]

I am having trouble writing to a samba share from a linux client (a Windows client can read and write just fine). According to ls -la run from the linux client, I should have full permissions: james@...
2
votes
2answers
94 views

sudo never works. I have no permissions on my computer [closed]

I want to reinstall Linux Mint..... Many commands start with sudo and then apt-get or whatever. I am never able to get past this. Typical attempt: john@john-AY022AA-ABA-p6330f:~$ sudo apt-get ...
0
votes
2answers
126 views

What happens if I change chmod permissions to rrr [closed]

I want to try to change /bin/chmod permissions file to rrr but afraid to loose my machine. What happens next if I change them?
0
votes
1answer
40 views

nosuid doesn't prevent chmod u+s

I follow a tutorial to secure my /etc/fstab file. This is a certain part about /var and /tmp UUID=XXXX-XXXX-XXXX /var ext4 defaults,nodev,nosuid,noexec 1 2 UUID=ZZZZ-ZZZZ-ZZZZ /tmp ext4 defaults,...
11
votes
2answers
1k views

Use chmod command selectively

I want to set 755 permission on all files and sub-directories under a specific directory, but I want to execute chmod 755 only for those components which does not have 755 permission. find /...
1
vote
1answer
289 views

Man page for file permission numbers

Is there a man page for the file permission numbers? I'm specifically talking about r = 4 w = 2 x = 1 I can never remember them and I have to google it every time I need to set permissions besides ...
3
votes
1answer
307 views

Why is /tmp mounted with permissions 0755 when fstab has 1777?

For /tmp in /etc/fstab, I have mode=1777, but after a reboot, the permissions on /tmp are 0755. Another directory /var/tmp is configured in exactly the same way but does not have this problem (see ...
1
vote
2answers
207 views

ls -I myExecutable is listing the rest of the dir files instead of showing info about the file

Working on Raspian, after compiling using make, I do a ls -I myFile in order to see the permissions of the file and if it is marked as executable as it should and instead of getting something like ...
0
votes
1answer
34 views

What happens if we, recursively, change folder permissions after changing files in it?

What will these below commands actually do? chmod 777 /yoda/htdocs/cups/logs/* chmod -R -f 777 /yoda/htdocs/cups/logs/ When I check the file permissions in ..../logs folder, they are showing as -...
-1
votes
1answer
1k views

chmod all files in a directory [duplicate]

How do I change all files (different types including .sh, .py, and other executable files) in a known directory to permission 775 without listing all of the file names? I mean "all" of them in that ...
0
votes
1answer
40 views

Solaris difference between 's' and 'l' in permissions

On a Solaris 11 machine, when I execute chmod 2000 myfile, I get l instead of S or s: touch myfile && chmod 2000 myfile && ls -l myfile ------l---. 1 pydoge pydoge 0 Oct 16 12:35 ...
-4
votes
2answers
49 views

Using octal method,how do I type the exact command I would use to make test.txt have the following permissions dr-xr-x— [duplicate]

Using octal method,type the exact command you would use to make test.txt have the following permissions dr-xr-x---
0
votes
1answer
440 views

can not set user write permissions to file in SMB mounted directory [duplicate]

I have mounted a Windows 10 directory so I can edit some files on my Windownz machine. sudo mount -t cifds //W10/Users ~/public/ -o username=bobby When checking the directories they all have the ...
4
votes
2answers
506 views

Permissions denied on files despite 777 mode

I am getting a permission denied error on CentOS 6.10 64 bit Kindly note that the "#" indicates a Root Level User prompt. # cd /tmp # chmod 777 file* # /bin/ls -l file* -rwxrwxrwx 1 apache apache ...
5
votes
5answers
406 views

Removing and adding permission using numerical notation on the same line

I'm having some trouble trying to remove write permission from the owning group (g), and to add read permission to others (o) at the same time. How would I remove some permission from the owning ...
2
votes
1answer
36 views

Can't access folder with group permissions

It seems that I can't access a folder on which I put 777 group permissions, even though I am a member of the folder's group. Error detail : 10:57 ~ $ ls -l d---rwx--- 2 laurent www-data 4096 août ...
2
votes
1answer
52 views

why while loop works from terminal if ld-2.17.so have no executable permission?

In my previous question, executed "chmod 666 ld-2.17.so" - how can i recover? I asked if I change ld-2.17.so permission to read, how can I recover it back, since it won't allow me to execute ...
-1
votes
1answer
28 views

why doesn't setfacl give executable permission?

I ran sudo setfacl -d -m g::rwx /tmp then went into /tmp and created a file and looked at its permissions: -rw-rw-rw-. 1 jm wheel 0 Aug 24 10:26 test_file then I ran sudo chmod g+rwx ...
0
votes
1answer
154 views

Change File Permission at run time

I have two users in a group. Users: 1) apache 2) data Group 1) apache I have three directories. The directory structure of that three directories are like below. drwxrwx--- 10 data ...
0
votes
1answer
116 views

How to add sticky bit to a directory in exFAT?

I get this error from Homebrew when trying to build an application on MacOS 10.10.5, on an exFAT filesystem Error: parent directory is world writable but not sticky I use this command to enable ...
0
votes
1answer
36 views

Can chmod on a directory without --recursive change who can read a file within that directory? [duplicate]

Based on the suggested duplicate, let me reformulate my question: If chmod 0660 path/to/folder is run, and user A isn't in the relevant group, could user A still read /path/to/folder/file.txt if that ...
2
votes
1answer
60 views

How to check if there are “other” permissions in home directories

Right now, I have a script that runs daily that chmod's the home directories, removing all "other" permissions from the directories and the "group" write permission. See below. #Removing all other ...
0
votes
1answer
39 views

Permissions Based on Lowest Level

My user account, samjaques, belongs to a group sams. I have two folders, both in the sams group. Folder 1 is owned by root, Folder 2 by samjaques. Both have permissions set as ---rwx---. From the ...
0
votes
0answers
113 views

How do I launch Phantombot Jar file on Linux Mint 19 Tara?

So I am following some steps to try and launch this Jar file. I am a Linux Mint 19 user of only a week or so, I used it once before but briefly. $ chmod +x launch.sh I am trying to launch this ...
4
votes
3answers
3k views

How to create a file that only sudo can read?

I'd like to have a file on my computer that stores a particular token (rather than having them just exported to the shell env). As such, I'd like that the token can only be read by sudo, so access to ...
0
votes
0answers
16 views

How do I find out what changed a file's user or group or permissions? [duplicate]

Something on our server is changing the user or group or permissions of certain files, and I'm not sure how to find out what's doing it. It seems to be random and our testing has not found out, and I'...
0
votes
1answer
212 views

Give read write-only access to specific folder?

I created an LDAP group rcars. I also created a directory rcars. How can I set permission so that only rcars group can read/write?
1
vote
1answer
528 views

Granting read/execute permission for 'other users' in a directory tree

There is the following directory tree in several of my Linux boxes: /dir1/dir2/dir3/dir4/target Each of the dir[1-4] directories have several directories under them and all these directories (and ...
-1
votes
1answer
271 views

chmod very slow on NFS [closed]

Is there any way I can speed up chmod on an NFS server? I am running chmod on a number of files each time a script is run. It is almost immediate when run locally, but when targeting the NFS server ...
0
votes
1answer
173 views

Give program access to only directories below cwd

Say I run a program like so: cd foo && program x y z How can I give program access to only the directories in foo and below? Pretend my fs looks like: $HOME/ foo/ bar/ baz/ if I run ...
-1
votes
2answers
93 views

What am I doing wrong with my linux commands? [duplicate]

I want to inherit every new file from my group so that I can have execute permissions, and no one else, but when I try to create new ones, it gives me 664 permissions how can I fix this?? sudo ...
1
vote
3answers
633 views

How to set the future permissions of content in folder

Let's say I am the user Alice and I have a publicly accessible folder /samba/public The permissions of the public Samba folder (/samba/public/) are nobody:nogroup and 0777. When Alice tries to copy ...
0
votes
0answers
18 views

Automatic rights change when virtual COM ports are enumerated

I am developing a uC device which enumerates as three virtual COMs (actually it is a composite device). Everything works perfect except one small thing. Those ports belong to the dialout group and can ...
1
vote
2answers
718 views

xargs + chmod - file or directory not found

I am trying to recursively change the permission of all files and directories in my project. I found a post on the magento forum saying that I can use these commands: find ./ -type f | xargs chmod ...
0
votes
1answer
913 views

Include password when mounting a drive using cifs

At first I using this to mount a shared drive: sudo mount -t cifs -o username=myuser //xxx.xxx.xx.xx/myfolder /mnt/windowsshare/ but then I didn't have modify access or ownership to the shared drive ...
3
votes
1answer
374 views

What is a chmod equivalent of mesg

What is a chmod equivalent for mesg y and mesg n?
0
votes
1answer
40 views

Executing command for each newline separated [duplicate]

I have this: chmod u+x $(find scripts -name "*.sh") But I believe it's only running chmod u+x for the first item in the list from find, since the results are newline separated. How can I run chmod ...
3
votes
1answer
43 views

Is there a benefit to securing all directories under a parent directory?

The sysadmins at work want us to remove all world permissions from all files and directories within a specific filesystem. Normally, I would agree with such security practices. However, I don't ...
0
votes
0answers
62 views

How to best solve user permission issue where a Lighttpd+FastCGI app's folder is located in /root/?

I have a Flask application on a docker solution. I have configured lighttpd to drop to "lighttpd" user and group. Problem is: The flask app is part of a bit larger project that's simply being copied ...
1
vote
2answers
57 views

How can I prevent ROOT from deleting a directory, but still allow root to have full control of all files and subdirectories within it?

chattr +a would be perfect if it only applied to the root of directory, not everything from there on. Is there a way to limit chattr to just the one folder (e.g. the opposite of -R as is normally ...
0
votes
2answers
151 views

chmod +x: affect file in one OS or all OSes

For example, I have a file named run.sh. I want to make this file executable, so I run: chmod +x run.sh My question is: This command makes this file executable. So if I bring this file to ...
1
vote
1answer
846 views

Giving different permissions to two groups for a single directory?

Let me explain the situation, I have 15 users which are assigned to a bunch of different groups. I gave rwx permissions to all 15 but 2 users (I simply made a group specifically for that) for a ...
0
votes
1answer
191 views

How to give permissions to a subfolder while denying access to folders above it

I have this structure: /home/the_user/folder/subfolder and I would like to have read and write access to it, but I want to be unable to read or write anything above it, that is /home/the_user/...