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
1answer
16 views

Can't delete file - only permissions change - why?

I am trying to delete a file and while it works fine through the shell, when I call my script from another program, instead of deleting the file, it merely changes the permissions to something odd: $ ...
0
votes
1answer
26 views

Solution for sudo chmod 700 /bin && sudo chmod 700 /bin

I accidentally run sudo chmod 700 /bin && sudo chmod 700 /bin Then I couldn't run sudo or any commands again please is there a solution?
0
votes
0answers
18 views

Make Python3 script callable from everywhere without making it an executable

I've got a folder: /root/Desktop/commands/ This folder contains many Python scripts that should be callable from anywhere from the terminal. How can I make it, that I say once, that all scripts in ...
1
vote
0answers
26 views

Why do files become 'invisible' when execution permissions are revoked? [duplicate]

This is somewhat related to my, now resolved, question here here. When I ran chmod 666 on group of files they stopped showing up in the GUI (thunar) but I could see them when I ran ls. When I found ...
0
votes
1answer
30 views

Files missing in GUI after recursive chmod or chown

I was trying to set permissions on all of the files in a removable hard disk. I had tried chown and chmod on the disk address (i.e. /dev/sdb) but I still couldn't move files as a user. Then I tried to ...
9
votes
2answers
914 views

Is it possible to forbid a specific user from executing files on /usr/bin without changing all files permission to 750?

I understand the concept of managing permissions on Linux with chmod using the first digit as the user, the second as the group and the third as other users as described on this answer in ...
3
votes
4answers
375 views

Permissions on folders vs files?

if I have a folder that's restricted with say 600, thus no access for group or everyone, but the folder contains files with 777, would this be safe? Are there any work-arounds to access the 777 file ...
3
votes
2answers
237 views

Recursive chmod to 644 where current permission equals 755

I copied a project directory to a portable hard disk, wiped my laptop and copied the project back, but now git reports loads of changes due to files that previously had 644 permission changing to 755. ...
0
votes
1answer
34 views

Is it possible to set the rights of a file numerically but only to the user? [duplicate]

It is possible to use chmod numerically to set all the rights of a file: chmod 644 file Is it possible to set the rights numerically only to user's rights? I work on Fedora Linux but the question ...
0
votes
2answers
23 views

Can't get permission for partitioned disk

When I tried copying files from my Home/Downloads folder to other partition of my hard drive, it returns the message 'Permission Denied'. I tried few of these: It just says: 'Read-only' whatever I ...
0
votes
2answers
72 views

chmod 001 or 111? Unix Permissions for executable files question [duplicate]

I am confused as to what this question is asking me to do. For context, hello is a c++ file. "Use chmod command again to make hello an executable, but not readable and not writeable for all users....
0
votes
1answer
300 views

Why rm gives warning when deleting a write protected file?

I have a regular file and I changed its permission to 444. I understand that as the file is write protected, we can't modify or remove the contents of file but when I try to remove this file using rm, ...
0
votes
0answers
44 views

Find and print permissions command in a csh file

Trying to create a .csh file that can find and display permission of the files in the directory. Using the following content of the script #!/bin/csh -b find . type -f \( -name "*.sh" -o -name "*....
0
votes
1answer
39 views

When can a process (with given uid/gid) write a file (with given user:group)?

I'm looking for a "logic statement" to know when file hello.txt owned by user1:groupA can be written by a process owned by user2:groupB. I currently see only those cases: the process can write it ...
0
votes
1answer
22 views

Change owner to a file when saved in a specific folder

I have a NAS with a directory for each member of my house. My user name, is member of each member's group. So I have access to folders of all users. I want, when I place a file, inside a user's ...
0
votes
0answers
35 views

Running commands with www-data privileges in scripts, crontab and systemd

I've already read "Allow www-data to perform specific commands" article. But, crontab and systemd invokes scripts using root privilege. # my-service.service [Unit] Description=My Service [Service] ...
0
votes
1answer
32 views

Executed chmod -R 777 to home directory by accident, remedy?

I accidentally ran chmod -R 777 to my home directory. I don't feel the change, but I'm afraid something bad will happen without me knowing. Is there a way to restore it to normal?
0
votes
2answers
64 views

Can superuser write a file having 000 access permissions?

I know that a root user can read a file even if the access permissions are all set to 0 but i don't understand about the write and execute permissions in specific. Can a superuser write and execute a ...
0
votes
0answers
18 views

fedora can not boot after run chmod -R 777 / [duplicate]

I have a problem in permission and run chmod -R 777 / . fedora can not boot and stop in 'Started GNOME Display Manager'.
-2
votes
1answer
38 views

How to change mode for a file on CentOS 7?

Want to change a file's mode to -rw-------. Use chmod 755 ~/.ssh/authorized_keys got a result as: $ ls -la ~/.ssh/authorized_keys -rwxr-xr-x. 1 root root 755 Dec 11 03:09 /root/.ssh/authorized_keys ...
0
votes
1answer
53 views

Permission issue

I am using an NTFS filesystem on a separate partition on Debian 9. I would like to change the permissions recursively in one directory on that filesystem. This are the current permissions: ...
0
votes
2answers
32 views

How do I make a directory part of a group?

I created a directory and the next step is to make that directory part of a group. Is this down with chown? Or another command? This is for my schoolwork. We have gone over permissions and changing ...
0
votes
1answer
57 views

useradd account cant login through GUI

I'm using KALI fresh install. Linux kali 5.2.0-kali2-686-pae #1 SMP Debian 5.2.9-2kali1 (2019-08-22) i686 GNU/Linux I created a user using useradd akkilah Then i added this user to sudo group ...
0
votes
1answer
83 views

How can I create a file with executable permission itself? [duplicate]

How can I create a file with executable permission itself? I want to create a new file with a single command with executable permissions how can I do it?
-4
votes
1answer
52 views

File Permissions Script

I'm new to scripting and need assistance writing a script that will go in the /var/log directory, and change all directories's permissions to 777 and all the files permissions to 666 in Linux. Any ...
1
vote
1answer
27 views

Why does getegid work for others but not me?

I have the following test program: //File: egid_test.c #include <stdio.h> #include <unistd.h> int main(int argc, char** argv) { int egid = getegid(); printf("my effective group is %...
0
votes
0answers
150 views

chmod not working in minGW64 but working Cygwin?

I need to do some file permission changes on win10, while I can run this command under cygwin but not in git bash minGW64, can someone help to explain why? The result as from the cygwin terminal: $ ...
0
votes
0answers
13 views

Group member can't write to directory unless added via setfacl — why?

I had an issue on a Ubuntu 16.04 install where a particular user can't write to a folder despite being part of the group. Permissions: ls -l drwxrwxr-x+ 10 www-data www-data 4096 Nov 1 10:52 ...
0
votes
3answers
96 views

Problem with recursive change of file ownership

Have a directory on a hard drive where I want to change all contents from owned by root to owned by tomc. I have tried Nemo, Krusader, and Nautilus (all launched as root, using sudo), all of which ...
0
votes
0answers
44 views

How to allow an unprivileged deployer user to run a certain command with sudo in a specific path?

I created a "deployer" user # Create user deployer sudo adduser deployer # Give the read-write-execute permissions to deployer user for directory /var/www sudo setfacl -R -m u:deployer:rwx /var/www ...
0
votes
1answer
81 views

File permissions not working

A file on my CentOS does not have write permission and can not be edited using vim. But using echo it can be written, why? [root@srv chap2]# cat raj.txt Hello World [root@srv chap2]# ls -l raj....
0
votes
1answer
64 views

Files downloaded from FileZilla have “-????????? ? ? ? ?” permissions and I can't chown them with root

I download some files through FileZilla and all of the files in subdirectories have this "???" owner/group permision: -????????? ? ? ? ? ? file_a.txt -????????? ? ? ? ? ? file_b....
0
votes
1answer
78 views

chmod: changing permissions of 'datenbank': Operation not supported [duplicate]

I have a USB drive sitting in my raspberry pi and I'm trying to sshfs into the drive. I already changed the permission of most files and directories on that drive but when I try to chmod 777 ...
0
votes
3answers
2k views

Can't `chmod` mount folder of read-only filesystem

I have a directory (mnt) that has world read access, but when I mount a filesystem into it as readonly (as root) it subsequently shows no world permissions, and if I try to chmod it I get a readonly ...
0
votes
1answer
92 views

I am creating directories using shell script and i am using 'chmod g+s' permission on the directory but the recursive permission is failing [duplicate]

I am creating directories in a shell script with below permissions chmod -R 770 /user/mydir chown -R user:mygroup /user/mydir chown -R g+s /user/mydir However whenever I am creating a new directory ...
3
votes
2answers
82 views

Issue with changing permissions

I don't understand why the permission does not change for a user when I run the chmod command with fakeroot. Initially, the file has these permissions: -rwxr-xr-x a.txt* When I try to change the ...
-1
votes
1answer
443 views

How to change file permission without chmod?

Our college assigned us a homework for Unix. We have to change the permission of a newly created file to 222 without using chmod. Decrease the file permission by "222" [Do not use chmod command]: ...
0
votes
1answer
310 views

How can I change the permissions on a usb flash drive?

My sd card in my usb card reader will not allow me to add files while in ext4. I checked permissions and it's in root. I'm hoping if I change the permissions to non-root, it will let me add files. ...
0
votes
0answers
162 views

Accidentally ran `chmod -R 755 *`. Is the situation desperate?

[Edit: See full list of commands I ran at the bottom.] I accidentally ran chmod +x * inside ~/.config which contained two .sh file that I wanted to make executable. There is no prompt for password ...
0
votes
2answers
50 views

Locking down image files in folders

I have a form which uploads a picture to an upload folder on my Gnu/Linux host. When the user registers, it creates a folder for them, in uploads, and puts their picture into it. I have disabled ...
0
votes
1answer
288 views

Set default permissions for new files and folders

I have an upload directory which has information fed into it by users, each time a user registers they submit a picture which creates a folder for them in the upload directory and stores their photo(s)...
-1
votes
1answer
58 views

How to write to file with redirection/pipes if it's read-only

So this seems to work: chmod 777 config.json node declarations.js > config.json chmod 444 config.json but that seems like extra steps. is there some way to write to a file with redirection and ...
0
votes
0answers
30 views

Can not access to sudo [duplicate]

I ran the command: sudo chmod -R 777 / And now I have that: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set Thank you for help!
-1
votes
1answer
34 views

How to change permissions of all the files in my directory?

I used a script to install Hadoop /opt/hadoop-3.2.0$ ll total 216 drwxr-xr-x 10 yarn hadoop 4096 јул 9 08:05 ./ drwxr-xr-x 9 root root 4096 јул 9 07:42 ../ drwxr-xr-x 2 yarn hadoop 4096 ...
2
votes
2answers
182 views

Can't create directory in directory owned by group

I have a group called homeperms on an Ubuntu system, with a few users: $ cat /etc/group | grep "homeperms" homeperms:x:1004:jorik,tim.wijma,vanveenjorik,jorik_c And I've done $ sudo chgrp -R ...
0
votes
1answer
244 views

Cannot change file/folder permission on Linux running on VMware

I am using Linux on a VMware on Windows and added a second HDD device today. However, each file or any dictionary that is created on the new device gets executable permissions which are not removable (...
0
votes
0answers
28 views

SetGID on folder with Active Directory users

I have a directory which staff are allowed to sftp into on an Ubuntu 18.04 server. The directory is root:www-data owned (it's a web server) and I've set chmod +t and chmod g+s so data cannot be ...
0
votes
0answers
161 views

Chromeos Linux Beta

I am attempting to install Krita on my chromebook. I have 'turned on' linux beta and chromeos prompts me that 'Shared folders are available in Linux at /mnt/chromeos...' Issue debian@penguin:/mnt/...
0
votes
0answers
24 views

How do I change permissions for only the folder and no subfolders or files contained therein?

I need to change permissions for a root folder, then change them straight back. All permissions for everything else should stay the same. So, I need to find out current permissions change them to ...
0
votes
1answer
120 views

Set File Permissions to Default from Umask

https://geek-university.com/linux/set-the-default-permissions-for-newly-created-files/ So I want my umask (command) which in this case is 0002 to be subtracted (bitwise) from 666 for files and 777 ...

1
2 3 4 5
10