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
0
votes
0answers
594 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
12k 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
106 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
3k 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
466 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
331 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
728 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
114 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
12k 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
77 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/...
1
vote
0answers
188 views

Setting umask for a user with no shell?

How can I set the umask for the Apache user to have files default to -rwxrwx--- ? I have an application that wants one directory to have either 0750 or 0770 permissions, which is great if it’s local, ...
0
votes
1answer
1k views

Change permissions of file when group has ownership, but user does not

I'm trying to change permissions of a file that my user does not directly own, but my user is in a group that does have ownership of the file. Here are the current permissions of the file. I am ...
0
votes
0answers
37 views

User Permissions Reverting After Save

I am using Redhat 6.9. I don't have root permissions. I have created a bash script called "script" (no extension). When I use chmod +x script to make it executable, I can run the script successfully....
0
votes
1answer
122 views

Prevent deleting files in particular directory

Recently, I deleted some files accidentally. Fortunately, I was able to recover them. That is why I would like to prevent deleting files in a particular directory but still allow to create new files ...
2
votes
1answer
377 views

How can I grant owning group permissions when POSIX ACLs are applied?

I am trying to understand how I can grant permissions to the owning group once POSIX ACLs have been applied to a file. Normally, I would use chmod g+rwx. However, that does not work when a POSIX ACL ...
3
votes
2answers
656 views

Unset setgid bit with chmod numeric mode

I've just noticed some interesting behavior with chmod when unsetting the setgid bit: $ mkdir test $ chmod 2755 test $ stat -c '%a %n' test 2755 test # as expected $ chmod 0755 test $ stat -c '%a %n'...
0
votes
1answer
43 views

Can I set a new file's owner (user) based on the folder as I can for group with `chmod g+s`? [duplicate]

I've recently learned about an amazing usage of chmod: chmod g+s /path/to/dir which makes every new file in that directory be put into the group that the directory itself is owned by. Is there a way ...
0
votes
0answers
284 views

SETUID and SETGID Behavior

The setup: ~$ ls -l /etc/sudoers -r--r----- 1 root root 614 2017-09-10 20:29 /etc/sudoers ~$ ls -l /etc/shadow -rw-r----- 1 root shadow 794 2011-04-18 11:49 /etc/shadow $ ls -l $(which ht) -rwsr-sr-...
-2
votes
1answer
105 views

Permissions to a script in a folder acting weird [duplicate]

I created a script, and I want it to be rwx only by root. All other can only x. What I have now [root@localhost /]# chmod 755 scripts/ -v mode of 'scripts/' retained as 0755 (rwxr-xr-x) [root@...
1
vote
3answers
116 views

Set permissions based on user permissions

Because of the default umask settings on my systems, file permissions always default to no access for group and other. This is fine typically but annoying when I'm installing software that I need ...
-1
votes
1answer
2k views

Run shell script at startup (Kali Linux)

This seems like a very basic thing to do, and I have even followed a few tutorials to get a simple script to be run at startup, but to no avail. Here is what my script, which is in the root directory,...
0
votes
2answers
523 views

chmod + change owner on all files under folder

I have very strange issue when we perform the following ( change owner from bash script ) on our redhat machine chmod 600 /etc/yum.repos.d/*.repo we get: chmod: cannot access ‘/etc/yum.repos.d/...
1
vote
4answers
90 views

How to securely sanitize permissions for a subtree

On our server, there are multiple (currently two, expected three or four) users allowed to deploy a new version of our application. This process consists of downloading a few files from a trusted ...
1
vote
0answers
1k views

How can I set device rw permissions permanently on ubuntu 16.04?

I am using an embedded device that is running ubuntu. Normally only root has read and write permissions for i2c devices. I'm using this command to add i2c r/w permissions for normal user (me): sudo ...
0
votes
1answer
2k views

ubuntu 16.04 a chmod command not excuted in rc.local automatically

I'm trying to run a chmod command in rc.local so that it gets executed at startup. The command enables the I2C device to be accessed. However, I need to manually run rc.local in order for it to work. ...
1
vote
0answers
336 views

FreeBSD permissions/ACL issue?

I'm a bit green with permissions/ACLs on FreeBSD 11, but this is puzzling me. root@svr: # su root@svr: # id uid=0(root) gid=0(wheel) groups=0(wheel) root@svr: ls -lt -rwxrwxr-x+ 1 root wheel 505 ...
-1
votes
2answers
65 views

File permissions do no work the way I intended [duplicate]

I have certain doubts regarding file permissions.I am gonna list them one by one. By the way I am logged in as root and using Red Hat Linux. 1.When I change the permission for a file to only read eg-...
2
votes
1answer
1k views

Permission denied even though I own it and permissions are 777

I'm on Android using Termux and copied a file from my sdcard to my Termux home folder. (I use a file explorer app with root permissions for that..) Now having the file in my home dir I checked what my ...
0
votes
1answer
910 views

How to map chmod access permissions to an integer

I came across a piece of code where chmod permissions are getting mapped to an integer. 33204 // -rw-rw-r-- 36863 // -rwsrwsrwt 36855 // -rwsrwSrwt 36799 // -rwSrwsrwt 36351 // -rwsrwsrwx 36343 // -...
0
votes
1answer
192 views

Debian backup files after chmod 770 in /etc

I broke my debian permissions by doing: chmod 770 /etc as root. I know its almost impossible to fix this without reinstalling but is it atleast possible to backup the files I created? I still have ...
-6
votes
2answers
1k views

Chmod Permission denied [closed]

I want to install dvwa on Kali Linux but I am unable to install it. These steps I have performed: I have moved folder dvwa to the /var/www/html/. But when I type this command in terminal # ...
0
votes
3answers
3k views

Give myself permissions for all files in / without bricking my computer? [closed]

How do I give myself read/write/execute permissions for all files in the root directory without making the system unusable? Would this command do it? sudo chown -R jacob3 / sudo chmod -R a+rwx / ...
1
vote
0answers
89 views

Ideal Linux ACL setup for ransomware

CAVEAT: This is mostly an intellectual exercise, since in case my user would get compromised, there is an entire cascade of events that could make this protection mechanism totally useless. ...
0
votes
2answers
227 views

Set permissions using chmod whilst in the wrong directory

I was doing a magento patch via Terminal and ran the following commands whilst in / rather than /public_html find . -type d -exec chmod 500 {} \; find . -type f -exec chmod 400 {} \; find var/ -type ...
0
votes
2answers
244 views

Can `chmod -R 777 /bin` be recovered from?

I know that chmod -R 777 / is extremely destructive, and I know that a chmod -R 000 /bin can be recovered by using an additional disk, but I'm wondering about chmod -R 777 /bin. If I have a root ...
0
votes
2answers
436 views

Chmod 4750 on mounted filesystem with chroot (but chmod 750 works)

I was following the gentoo installation guide. But I stucked at the updating the world set part because I was not able to install dbus with emerge. It was failing to change SUID permission of its ...
12
votes
1answer
1k views

Would chmod 000 /dev/stdin disable terminal forever?

I'm working through questions from Unix The Textbook (chapter 8, #16, page 207): Give chmod command lines that perform the same tasks that the mesg n and mesg y commands do. (Hint: Every hardware ...
0
votes
1answer
471 views

remove s from permission

here is my file : srw-rw---- 1 nfsen nfsen 0 mai 16 10:51 nfsen.comm and I want to remove the s ,I tried comething like chmod 0660 nfsen.comm but didn't work, any ideas ?
1
vote
1answer
171 views

Different behaviors between find -exec and piping through xargs [duplicate]

I wanted to recursively run chmod go+w in a particular folder including hidden files, and I first tried find . -name ".*" -o -name "*" -exec chmod go+w {} \; but I found that it wasn't affecting ...
11
votes
2answers
12k views

Difference between chmod vs ACL

I understand chmod and chown and how the permission bits work, but there is another permission system inside Linux, ACL with setfacl and getfacl, so this makes me wonder. What's the difference ...
1
vote
1answer
2k views

Why my chmod isn't working as expected? [duplicate]

I want to set my folders permissions to 555 and my files permissions to 554, so I tried the following chmod: sudo chmod -R -v ug=rx,o=r,a+X mydir/ I thought this would set the user and group ...
0
votes
1answer
91 views

Solaris file permissions not inherited by OAG log files

OS: Oracle Solaris 11.3 SPARC Issue: I'm trying to inherit file permissions using ACL and it's partially working. For the files and directories I create on my own in the shell permissions are ...
2
votes
1answer
206 views

Remove user permission for specific folder

I have created folder in home. I have also created new user. I want that specific folder can only be accessed by the new created user. I want to remove root privileges for that folder. I am using ...
0
votes
0answers
124 views

After changing all file permissions to 000, how to change it back to normal? [duplicate]

Sometimes, just to make sure all files are private, a command sudo chmod -R 000 . If we want to change back the permissions back to "normal", what command can be used? sudo chmod -R 777 . will not ...
9
votes
3answers
298 views

Permissions on Files:

I would like to give 755 permissions to a directory, so I use: # chmod -R 755 /my/folder/ It works for all files inside my folder, but the problem is that I use scripts that create new files in this ...
1
vote
3answers
443 views

chmod - What does this command do?

I found this command lines on the net: find . -type f -exec chmod 644 {} + find . -type d -exec chmod 755 {} + I'm not sure of what they do when executed... In theory I guess they go search of all ...
1
vote
1answer
24 views

Data accessible from other systems with the same UID?

Say I've got two dual-boot Linux systems on the same computer. Both share the same /home mount point. Amy, the only user on system 1, has a UID of 1000. She stored some files in /home/amy. Bill, the ...
-1
votes
2answers
2k views

sudo chmod-R 777 / [duplicate]

Hypothetical situation: What would be the long term effects of running sudo chmod -R 777 /? I know that it means that all users have full permissions on all files, but are there any other side-effects?...
1
vote
1answer
1k views

rsync + chmod multiple files

I have a source folder source/ -rw-------@ 1 user staff 41B Mar 23 13:59 aws-1 -rw-r--r-- 1 user staff 112B Mar 23 14:36 aws-2 -rw-rw-rw-@ 1 user staff 2.3K Feb 5 17:15 google the ...