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
1answer
665 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
373 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
176 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
96 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
770 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 ...
2
votes
2answers
965 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
1k 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
396 views

What is a chmod equivalent of mesg

What is a chmod equivalent for mesg y and mesg n?
0
votes
1answer
41 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
44 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 ...
1
vote
2answers
63 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
176 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
1k 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
413 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/...
1
vote
1answer
3k views

Change ownership of a share drive

I have a windows machine locally connected to my linux machine. There is a shared folder on the windows machine, which I mounted on my linux machine using sudo mount -t cifs -o username=myuser //xxx....
3
votes
1answer
244 views

How to make autoconf use “install” instead of “mkdir -p”?

When I run sudo make install on a compiled package from the GNU archive, it uses mkdir -p to create the destination directories. I'd prefer it to use mkdir -p -m 0755 or install -d -m 0755 instead in ...
1
vote
0answers
184 views

Confused about using `setuid` on a FreeBSD mounted dataset to ensure all files/dirs have a fixed owner?

Initially I thought that what I'm trying to do was simple. But the more I look at FreeBSD man pages, the more confused I'm getting about whether it's even possible. I have a zfs pool that is used for ...
0
votes
1answer
250 views

Accidentally changed permissions on entire /etc directory…or did I?

I've been setting up a hosting platform on a VPS running Centos 7. I've been going through some admin tasks and accidentally ran a couple commands within the /etc directory: find . -type d -exec ...
5
votes
4answers
2k views

How to chmod only on subdirectories?

Given the following directory tree: . ├── d1 │   └── workspace ├── d2 │   └── workspace ├── d3 │   └── workspace ├── d4 │   └── workspace └── d5 └── workspace I need to set the permissions for ...
0
votes
2answers
537 views

tar command create directory without 777 permission

I run into an error while extracting a tar file, the created directory are created with the chmod 666 instead of 777. Therefore it will not extract inside this folder. Here is my command: $umask 000 ...
0
votes
1answer
65 views

Permissions in a shared server (chmod)

I have recently been given an account on a Linux server. This server is shared with different members of a research institution and the standard permissions allow other users to access my directories ...
16
votes
3answers
7k views

Why does chmod +w not give write permission to other(o)

When I run chmod +w filename it doesn't give write permission to other, it just gives write permission to user and group. After executing this command chmod +w testfile.txt running ls -l testfile....
-4
votes
2answers
486 views

In Fedora what corresponds to chmod?

I want to use the following command, which is for Ubuntu and Debian users: chmod 600 MOK.priv However, I am using Fedora 27 and it does not work for me there since I get Command not found.... Does ...
0
votes
2answers
563 views

How to change read-only permission of external hard drive

I have an FreeAgent GoFlex Drive that I would like to save data to via my Raspberry Pi 3. I'm able to view jpegs from the drive, but not save data to it. When I attempt to change permissions, I get ...
0
votes
1answer
43 views

Make all files in a dir executable (non-recursively) while strictly-ensuring non-recursivness

I grasp the heading of this question odd, but I do wonder if in some situations there should be a need to take extra caution and somehow "enforce" non-recursivness when changing permissions with chmod ...
0
votes
1answer
787 views

chmod issue in bash script

I have a script to format a drive, set permissions (777), copy a file, change permissions (555) and unmount and eject the drive for cinema DCPs. Currently everything is working but I'm getting an ...
0
votes
2answers
459 views

chown does not give me any right

I have a folder, my-folder. From its parent directory, I first do: sudo chown -cR matthewslouismarie: my-folder If I then do: chmod -cR 600 my-folder, I get: chmod: cannot access 'my-folder/build....
0
votes
1answer
56 views

Having trouble finding and changing permissions to a script in Unix [closed]

I want to change user permissions to execute hence the u+x via https://kb.iu.edu/d/abdb I read {} is the thing "find" finds, and \; ends the command. and also read -exec chmod just initiates the ...
1
vote
3answers
819 views

What are the commands to change value to msgmnb?

I've tried cd /proc/sys/kernel/msgmnb followed by sudo chmod u=rwx msgmnb to get permissions for changing the value but i didn't get them, how can i do it?
-2
votes
2answers
217 views

How to give write rights of a file to a group [closed]

I want to make a folder writable by any user in a group So I first create a new group like this: sudo groupadd newGroup then I add user1 and user2 in this group like: sudo usermod -a -G newGroup ...
0
votes
2answers
866 views

FreeBSD sed error - I have permissions, but “Permission denied”

Permissions: ls -al file -rwxrwxr-x 1 root wheel User group: groups wheel If I do this: sed -i'' -e '/Marker/i\'$'\n''text string'$'\n' file I get an error: sed: ../file: Permission denied ...
7
votes
3answers
5k views

What is a capital X in posix / chmod?

I know what's ugoa (owner, group, others, all) or rwx (read/right/execute) or 4,2,1 or -, f, d, l, and I tried to read in man chmod to understand what's a capital X in chmod but there wasn't an entry ...
0
votes
1answer
879 views

Combine find-chmod for directories and find-chmod for regular files [duplicate]

I have these commands: find /var/www/html/* -type d -exec chmod 755 {} \; find /var/www/html/* -type f -exec chmod 644 {} \; I understood from Stephen Kitt's answer here that I could combine them ...
0
votes
2answers
68 views

What is the proper permission to a directory while creating a file in it

I, as a normal user (not root), am trying to create a file in a directory as below: touch a/b/c/d/test.log However I get an error: permission denied. I know that I should chmod for the directory ...
2
votes
1answer
272 views

Recovering from removing execute permission from ld-linux.so

After reading about removing the execute permission from chmod, I got curious. Is it possible to recover from removing the execute permission from ld-linux.so without rebooting if I haven't yet exited ...
1
vote
0answers
415 views

vsftpd with virtual users and independent directory configuration

I followed the nice tutorial from https://askubuntu.com/questions/575523/how-to-setup-virtual-users-for-vsftpd-with-access-to-a-specific-sub-directory Now If I understood I have 2 things: 1) one is ...
1
vote
2answers
58 views

1)How many processes have priority higher than 80? 2) How many executable files that have setuid bit set are there in /usr/bin?

For the first question I tried: ps -le | tail -n+2 | awk '{if($7>80)print $7}' | wc --lines and ps -eo pri | tail -n+2 | awk '{if($1>80) print}' | wc --lines Surprisingly both gave ...
0
votes
1answer
109 views

Why does the group need --x permission on the parent directory?

I was trying to get the user nagios to have access a sub directory in another users home directory /home/alert/NagiosAlerts/. I was going crazy setting permissions that should have been to high to ...
0
votes
0answers
525 views

chmod does not change the folder permissions on an NTFS filesystem

I have recently installed Debian 9, and I have been facing many problems since then. The hard drive was previously used for a Windows install, and is not completely formatted, so it contains two ...
-1
votes
1answer
11k views

Getting “Permission denied” even though I have set global read permissions on a file

I'm using Amazon Linux. I have set global read permissions on a file, but I can't seem to access it as a normal user: [myuser@mymachine ~]$ ls -al /usr/java/jboss/standalone/deployments/myproject.war/...
2
votes
1answer
100 views

Permission for group user to change permissions

After I set the permission to have both groups added to different user I am still not able to change the permission for directory and files. id adminOne uid=495(adminOne) gid=492(apps) groups=492(...
1
vote
2answers
2k views

Accidentally set chmod 777 to /var/log

So I've set chmod 777 -R to /var/log on Raspbian and now I get some errors when logrotate runs. The errors are like: error: skipping "/var/log/apt/term.log" because parent directory has insecure ...
7
votes
3answers
2k views

Permissions remain 2700 after `chmod 0700`

Example: # show starting permissions % stat -c '%04a' ~/testdir 0700 # change permissions to 2700 % chmod 2700 ~/testdir # check % stat -c '%04a' ~/testdir 2700 # so far so good... # now, change ...
1
vote
1answer
422 views

Sync files with permissions from linux to windows?

Is it possible to sync files from a linux machine with a given permission set (for instance, 700) to a windows machine (having a ntfs partition) and still retain linux permissions? I know that copying ...
1
vote
1answer
254 views

how to add execution permission (+x) to all scripts

we have under /var/scripts/.../.../.. a lot of script as ( .sh .bash .py ) /var/scripts/.../.../klo.py /var/scripts/.../.../klo.sh /var/scripts/.../.../kjrbom.py . . . . how to add for these ...
0
votes
1answer
670 views

Changing umask value

I want to change umask value from 022 to 002 for a particular user jboss. Right now it is set as follows in /etc/profile: if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then umask 002 ...
-1
votes
1answer
104 views

Is “install” a shortcut for cp + chown + chmod, or does it do more?

I read man install, and it seems that it just copies files with ownership & mode. So, is install a shortcut for cp + chown + chmod, or does it do more, under the hood?
2
votes
1answer
11k views

How are chown and chmod command different in the given operation?

If I change the ownership of the contents of a file and further set permissions to the content of the file, how exactly are both the operations different? For example, if I change the ownership of ...
1
vote
0answers
74 views

Permissions not getting assigned from parent directory when creating new sub directory

The issue for me when we I create a new subdirectory , it is not copying the execute permissions for group from parent directory . Permissions are as follows: Parent Directory: $ ls -ld /data/share/...