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
1answer
3k views

Can't read file with chmod 777 [closed]

Shell [root@server~]# su -s /bin/bash user123 bash-4.1$ cat /home/user567/folder/textfile.txt cat: /home/user567/folder/textfile.txt: Permission denied File permissions /home/user567/folder/...
0
votes
1answer
664 views

Permission error when creating backup on gitlab omnibus installation

I am using gitlab version 7.10.4 and I am trying to upgrade the installation. But I am getting this when I tried to create back up gitlab-rake gitlab:backup:create Errno::EPERM: Operation not ...
1
vote
1answer
547 views

Shell script for kill command

I'm following a tutorial on using text editors and one exercise was to make a "safer" kill command script. I made a ~/bin directory. Then made the following kill command script called ekill. #!/bin/...
0
votes
1answer
2k views

permission denied /dev/bus/usb/

I'm confused by "permission denied" despite apparently having correct permissions to /dev/bus/usb/005/017. This is similar to this question, but I have already tried restarting my ssh session. $ ...
3
votes
3answers
2k views

Monitor chmod progress

I'm currently changing the permissions and ownership on a 4TB HDD filled with files. Is it even possible to monitor the progress of commands such as chmod and chown?
7
votes
2answers
82k views

chmod: changing permissions of directory Operation not permitted

I have done chmod -R 644 . inside the directory dir My user's permissions are drw-r--r-- and i'm the owner of the directory When trying chmod 755 dir, error is popped chmod: changing ...
1
vote
2answers
122 views

Does busybox chmod 03755 generate any disk write I/O when directory permissions are already set correct?

I am writing a startup script for a daemon that runs inside an embedded Linux installation. That means that chmod is from BusyBox v1.24.2. I don't want to cause any unnecessary write cycles on flash ...
0
votes
1answer
2k views

How to revert a “sudo chmod 644 .*”?

guys! This is my first post here and, unfortunately, and it's being made in very ugly circumstances! I'm running Debian Jessie x64 and an hour ago I installed some fonts for figlet into the /usr/...
2
votes
0answers
260 views

chmod and chown have no effect on mounted CIFS share, but emit no error either

I have an SMB share on a Buffalo NAS (nas01/storage) mounted on /storage. From /etc/fstab: //nas01/storage /storage cifs file_mode=0644,dir_mode=0750,uid=1000,gid=1000,passwd="XYZ" 0 0 It mounts ...
2
votes
2answers
67 views

Unable to use sudo and other apps

I've been learning file security on my main OS (Ubuntu 16.04). I changed my /usr directory's permissions by executing sudo chmod 750 /usr command. Now, I'm not able to execute any app and not able to ...
-1
votes
1answer
2k views

Allow a user to create files in another users directory

I have a website which is owned by user apache and group apache and I want to allow another user to be able to work within a folder on the website - I need them to be able to edit and create new files ...
-2
votes
1answer
59 views

How can I have a user who can write files but cannot delete them? [closed]

I want to have a user who can write files; but I don't want this user to be able to delete them.
0
votes
1answer
319 views

Centos 7 --> Logging Failed Permission Changes By Another User?

I've been trying to figure this one out and it seems like a rather easier said than done situation. I am currently setting up a server that sends errors, failed logons, who accessed what and when, etc....
0
votes
1answer
198 views

Did i really screw up my system using chmod? [duplicate]

So I was messing around with permissions on a linux box and was trying to change permissions so a user couldnt access any folders other than what is in their home directory. I did sudo chmod 0750 /...
0
votes
2answers
95 views

Grant only selected users access to a given folder

I have a linux system. And multiple users are logging into it via ssh. So I have created multiple user accounts. The problem I have is that some of those users need to cooperate on a given task, and ...
1
vote
1answer
4k views

Readonly file and can't change permissions

There is a file with read only permissions, but even root can't chmod it. Permissions of the file: -rw-r--r-- After trying to chmod 777: chmod: changing permissions of ‘motd’: Operation not ...
1
vote
0answers
45 views

How to recover system when wrongly entered command? [duplicate]

I wrongly entered chmod -700 /. My entire system collapsed. All applications shutdown automatically. Then I restarted my computer. I could no longer login. What happened, and how can I fix it?
0
votes
1answer
514 views

Change permission recursively for all directory and exclude only one directory

I would like to change the permission recursively all files and directories but exclude some directories. find . -name user -prune -o -type d -exec chmod 755 {} \; But using this, its only change ...
1
vote
2answers
327 views

Chmod/chown permissions question [closed]

I have 2 users, GM and FTP. I want GM to have read access, and FTP to have all access. How can I do this?
0
votes
2answers
11k views

Unable to run sudo command on linux

I am using Linux CentOS but suddenly I couldn't run sudo command. I got below errors. Even with root user it got the same error. $ sudo ls sudo: unable to stat /etc/sudoers: Permission denied sudo: ...
6
votes
5answers
2k views

Allow group to r/w in folder owned by a specific user

I have a group manager and an user user1. user1 will create a directory by example in the webserver path /var/www/user1Project. How to allow the group manager to r/w in any directory owned by user1 ?...
-6
votes
1answer
10k views

Difference between changing permission Recursively or without Recursively

What is the difference in the command chmod 777 * and chmod -R 777 * changing permission recursively or normally?
2
votes
2answers
2k views

Recursive chmod without sudo

I accidentally executed the following: chmod -R 741 /* (forgot the dot, yes). So the next thing I know is my terminal riddled with errors and I stop it in /mnt/ directory. At this point I realise what ...
3
votes
2answers
7k views

Is `chmod -R ugo+rwx /` safer than `chmod -R 777 /`?

I read here that chmod -R 777 / is a really bad idea, because it overwrites permissions on files, and erases sticky bits and setgid and stuff. However I was thinking that chmod -R ugo+rwx / would not ...
5
votes
1answer
1k views

How can I recover from a `chmod -x chmod`? [duplicate]

Assuming that you can't reach the internet nor reboot the machine, how can I recover from chmod -x chmod ?
4
votes
0answers
6k views

NFS exports all_squash,anonuid,anongid mapping all client users to owner on server (working) still needs world readable permissions on the server?

My /etc/exports on the NFS server: /home/username/Documents/some/folders/deep 192.168.1.10(rw,sync,all_squash,anonuid=1000,anongid=1000) This seems to be working as intended for the most part. ...
0
votes
2answers
2k views

Can I change the permissions of files that root has read only access to?

A few days ago I made the switch from Debian to Arch. When I did that, I backed up my files to an external harddrive. I've moved the contents of that backup to my normal harddrive. Now I'd like to ...
0
votes
1answer
101 views

How to I allow direct write access to a directory under /home/username?

For some reason after reinstalling Debian 8 (LVM encrypted) I need to sudo for any writing command in certain directories of /home/manuel/ directory (not even all of them!). I tried chmod a=awx [-R] ...
2
votes
2answers
1k views

Adding others rw permission to file

I have list of file with permission -rw-r-----. I want modify this permission and give access to other. i.e -rw-r--rw- Without modifying current permission setting, just add permission to 'other' ...
1
vote
2answers
1k views

Accidentally changing permission of '/' directory to 'chmod 660 '

After executing $ sudo chmod 660 /, I can't login with any of the users besides root. How can I restore the permissions ?
12
votes
1answer
3k views

Root can't chmod?

In my department we have a small file server with CentOS and samba. I have root access to be able to perform some basic maintenance. Today I was making some folders read-only, so I went ahead and did ...
3
votes
1answer
960 views

Linux: Changing Permissions – No space left on device

I have an external drive. When I just plug the drive into the PC, with a default /etc/fstab file, the OS just detects it and it's there in the Dolphin browser. I can select it, I can navigate to it on ...
0
votes
1answer
407 views

Clarification: permission and owernship by the apache process of web root

I've read through a lot of articles about correct/secure (1) ownership and (2) access permissions for directories and files in a web accessible directory served by apache (e.g. /var/www/). Either I'm ...
1
vote
1answer
6k views

Changing permissions of the file, while using sftp command in a shell script

How can I change the permissions of the file/command, while using the sftp command via a shell script? My sftp connection is established, but it fails while executing the chmod command. As of now, I ...
1
vote
4answers
181 views

Is there a way to show the permissions for a file without using `ls`

That's all - just wondering if there's other way to find out the permissions for a file without doing a ls -l to see the string of values there. As far as I know, there's no show option in chmod.
5
votes
1answer
520 views

RHEL sudo still not allowed for user 'tina'

I'd like 2 users, 'tina' and 'lu' to execute a few utils like /bin/chmod. Here's the relevant portion of my /etc/sudoers file. tina,lu ALL=/bin/chmod /bin/chown /bin/chgrp Then I logged in as myself,...
-1
votes
2answers
345 views

Confused by this chmod command [duplicate]

Why does the command chmod 6754 correspond to the file permissions rwsr-sr-? I understand that Read = 4, Write = 2, and Execute = 1, but what value does the s (setuid) permission or the dashes have?
1
vote
2answers
474 views

Finding files and directories with different umask

I have an umask as a 0002 using umask -S it returns u=rwx,g=rwx,o=rx. How do I find all files and directories that does not have rights set up according to mask? The directories goes 777 - mask and ...
0
votes
1answer
224 views

Cannot Bash chgrp GROUP /home/*/SOMEFILE/ How to do it?

So am setting a code that will change group owner of the file to a specific group. PS there are more than 10 users, with same folder and file structure, and i want change the ownership of a specific ...
1
vote
1answer
466 views

Why is chmod recursively changing file permissions as well?

When I do chmod _+x -R /dir where "_" is any combination of (u,g,o,a), if after I do chmod g+X -R /dir, the files gain executable permissions as well. Why does this happen? This behavior only ...
0
votes
2answers
2k views

Issued chmod 666 * in home directory, permissions problems resulted with all files

I was attempting to give any regular user access to two folders that reside a few branches down in my home folder. I thought I was in the correct directory and typed out sudo chmod 666 *, but ...
1
vote
1answer
397 views

Access manpage(2) on OS X

In Mac OS X, at the end of the chmod man page, it shows See also: chmod(2) But when I enter man chmod(2) It says that there is no such man page. How can I access the man page chmod(2) man page? ...
4
votes
2answers
541 views

Restrictive “group” permissions but open “world” permissions?

I understand that with Unix file permissions, there's "user", "group", and "world" octets. For the sake of this discussion, let's assume that setuid/sticky bits don't exist. Consider the following ...
4
votes
3answers
192 views

What are the conventional file permissions per filetype before umask is applied

I am looking for a list that specifies the conventional file permission of all the different file-types before the umask is applied. I read in man 1p touch that the default for a regular file is: ...
0
votes
1answer
182 views

How do I achieve this task of creating a shared folder and controll newly created files [duplicate]

I am attempting to conceptualize how to go about solving this task. First, here is the task in full. RHCSA7: Task of the day Allowed time: 10 minutes. Create two new user accounts "steve" and "...
0
votes
1answer
5k views

Minimum file permissions to rename file

I put a 64-bit ELF file in my unprivileged user's home directory. I wonder which permissions do I need to have only possiblity to rename this file being logged in as unprivileged user. From what I ...
0
votes
1answer
3k views

trouble understanding GID and chmod g+s

I am having trouble understanding the GID and the command chmod g+s I read this as setting the permissions of the passed file or directory, for the group, as +s (sticky im assuming?) Does the +s mean ...
1
vote
1answer
484 views

How to give write / create right to not yet existing files w/o write access of the parent directory?

I don't know if this is even possible so I need to ask. I'd like to allow a single file to be created by a user (a flag-file) but only that file should be able to be created. As I have the parent ...
1
vote
0answers
614 views

rsync + chmod only selected files

I'm trying to sync specific cron files between 2 servers and change the permissions for them. However, the command I am trying is also changing the permissions on the main directory. Command used: ...
0
votes
1answer
251 views

Samba unix permissions messed up despite mask

I'd like to configure a share on a standalone samba serve where users have rw to their own files, but r to others in the same group (rwx and rx on folders respectively). It works well when users ...