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
3
votes
1answer
1k 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 ...
-2
votes
0answers
24 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
40 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
1answer
53 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 ...
14
votes
2answers
26k views

Difference between “chmod 775” and “chmod 2755”

What is the difference between chmod 775 and chmod 2755?
0
votes
2answers
28 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 ...
65
votes
3answers
175k views

SSH Key Permissions Chmod settings?

I need to use SSH on my machine to access my website and its databases (setting up a symbolic link- but I digress). Following problem: I enter the command: ssh-keygen -t dsa To generate public/...
2
votes
2answers
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 ...
-4
votes
1answer
51 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 ...
0
votes
1answer
65 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?
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
29 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
12 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
32 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 ...
16
votes
2answers
40k views

chmod: What does the `+a` parameter mean?

I was following a tutorial and it told me to run sudo chmod +a "SOME_PARAMS" some/dir I was surprised to see that fail telling me chmod: invalid mode: `+a' So I wonder: What does the +a mode mean? ...
1
vote
2answers
949 views

Find all .php files inside directories with writable permissions

I'm looking for a linux command to scan through all writable directories on the server and show ones with .php and .html files inside them. Something like: find -type d -writable -exec find {} -...
9
votes
3answers
307 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 ...
0
votes
0answers
28 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
55 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 ...
16
votes
3answers
11k 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....
0
votes
1answer
77 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
42 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
3answers
881 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
79 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 ...
7
votes
4answers
3k 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 ...
3
votes
2answers
56 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 ...
0
votes
1answer
7k 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
votes
1answer
239 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
58 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. ...
104
votes
4answers
147k views

Get the chmod numerical value for a file

In FreeBSD and also in Linux, how can I get the numerical chmod value of a file? For example, 644 instead of -rw-r--r--? I need an automatic way for a Bash script.
0
votes
0answers
142 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
1answer
2k 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 ...
1
vote
1answer
131 views

Can't open file even though directory/file is owned by user and in group

I am having a really tough time understand user/group permissions. I have spent hours reading and trying things. Here is what I have: Directories Permissions Input 1: ls -lhd Output 1: /var/log: ...
0
votes
2answers
39 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
58 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)...
70
votes
5answers
59k views

Understanding UNIX permissions and file types

I've never really got how chmod worked up until today. I followed a tutorial that explained a big deal to me. For example, I've read that you've got three different permission groups: owner (u) ...
-1
votes
1answer
45 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
32 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
86 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
115 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 (...
2
votes
3answers
4k views

How to exclude hidden files in recursive chmod?

I am having to do chmod -R 755 some_dir where 'some_dir' contains '.git' folders. Is there any way I can exclude hidden files and folder when doing recursive chmod? Note: chmoding .git folder is ...
33
votes
3answers
181k views

How to create a Samba share that is writable from Windows without 777 permissions?

I have a path on a Linux machine (Debian 8) which I want to share with Samba 4 to Windows computers (Win7 and 8 in a domain). In my smb.conf I did the following: [myshare] path = /path/to/share ...
0
votes
0answers
18 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 ...
1
vote
2answers
2k views

How to change permission of /proc/self/pagemap file?

I want to change the pagemap file permission to 755 or 744 using sudo chmod. But the command is throwing error saying operation not permitted. The motivation is to allow a user read the pagemap file (...
0
votes
0answers
105 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
22 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
92 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 ...
0
votes
2answers
467 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/...
0
votes
0answers
34 views

Permission setup for two different groups of users in the same directory

I need to find the optimal permissions layout for the following use case: There is a AIX machine used for collaborating on software projects. Each project has its own sub-directory. For each project,...