Questions tagged [chmod]

The `chmod` command is used to adjust file permissions to read, write and execute for the owner, group and others.

Filter by
Sorted by
Tagged with
1 vote
1 answer
12k views

"No such file or directory" after chmod

I downloaded my professor's "shell" program and am trying to run it on my machine to do some homework. When I tried to run it from terminal using ./shell I got a "Permission denied error". After ...
26 votes
9 answers
6k views

How to fix "chmod" permissions after running "chmod 222 /bin/chmod"?

I ran chmod 222 /bin/chmod to know more about chmod. After that, when I run /bin/chmod, I get permission denied. I tried to change the permissions of chmod back to 755, but it doesn't work. Does ...
0 votes
0 answers
28 views

Ubuntu 22.04 katlooon installation errors when running git commands and directory doesnt exist

im on ubuntu 22.04(?) and im trying to install kali repo apps (im still learning Linux i might sound confusing) and i installed git in terminal but when trying to get katloon it installs the first ...
8 votes
2 answers
1k views

What's the difference between + and = when using chmod?

I read everything about chmod, but I don't get something. If I write chmod u=rwx file this "affects" me for all rights on the file, and if I write chmod u+rwx file this "adds" me all the rights on the ...
0 votes
0 answers
59 views

Setting Default 666 Permissions for Specific File Types (.xlms, .png .pdf...) in Linux Using ColdFusion

I am working on a project using ColdFusion on a Linux system, and I need to programmatically set default permissions (666) for files with specific extensions (.pdf, .xlsx, .png, .html, .zip). Despite ...
0 votes
2 answers
116 views

Is it possible to revert sudo chmod 777 -R /home/USER/docker?

I'm starting to learn more about Linux and Ubuntu while I'm building a home server. But when reading a tutorial I was suggested to add sudo chmod 777 -R /home/USER/docker in the terminal for the ...
1 vote
2 answers
8k views

Can't get correct permissions for /var/www/html/

I've read several threads here talking about this issue and tried all the solutions provided, none of them are working. Whenever I try composer install I get a bunch of errors saying cannot install [...
2 votes
1 answer
5k 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
1 answer
6k views

Couldn't Display [program] -- No application installed for "shared library" files

I think the problem is -- to Ubuntu, it doesn't seem that some of the files are executable at all or rather it doesn't know its file to type. The Files Manager due to which instead of showing the ...
1 vote
1 answer
2k views

/run/user/1000 is not owned by UID 1000, as it should

So I have this error going on, and its the origin of a lot of errors with snap that I'm recieving. So when I execute: $ systemctl status display-manager Recieved some text and: gkr-pam: unable to ...
0 votes
1 answer
90 views

sudo chgrp and sudo chmod will be reset after reboot

quick summary: I met some problem during my work on OrangePi 5 plus develop board, the operation like chgrp and chmod will be reset as default after reboot. I installed official Ubuntu 22.04 image ...
1 vote
2 answers
7k views

Shared Folder permission Denied on Ubuntu 18.04

I have a strange problem with Ubuntu file permissions. I have a fresh ubuntu installed server and I've mounted a shared drive. sudo mount //Hostname:ifs/path/to/directory/file /mnt/my directory. The ...
2 votes
1 answer
463 views

How to change permissions (chmod)?

I have created a folder not in /home but on other volume which is free (eventually I'd like to share the folder via Samba). I have found the path: /media/xduser/kingstone I did: cd /media/xduser/...
72 votes
12 answers
61k views

What if I accidentally run command "chmod -R" on system directories (/, /etc, ...)

I accidently ran sudo chmod 755 -R / instead of sudo chmod 755 -R ./ I stopped it after a few seconds, but now I'm starting to have problems. For example, sudo isn't working anymore: sudo: must be ...
13 votes
1 answer
11k views

'chmod -644' would set file permission to 000

I had a file with 644(-rw-r--r--) and wanted to change it to 664(-rw-rw-r--), after running: sudo chmod -664 my_file file permissions were set to 000(----------). Trying to change the permissions ...
0 votes
1 answer
4k views

Always get permission denied on tar. cannot mkdir: permission denied on my kafka installation [duplicate]

basically this is my question in stack overflow but not answered yet https://stackoverflow.com/questions/67708710/always-get-permission-denied-on-tar-cannot-mkdir-permission-denied-on-my-kafka so i ...
0 votes
1 answer
56 views

Won't boot into recovery or normal after running chmod command as root in recovery

I screwed up big time with my home server. I lost sudo on my user account and was following a guide to re-enable it. I went into recovery mode and when into the root shell and ran these commands: ...
3 votes
2 answers
2k views

chmod has no effect on files on flash drive

My old box running ubuntu 9.04 passed away, so I plugged a flash drive into a newer box running ubuntu 16.04. But, I can't run scripts from there, because all files lost the x-permission. I can copy ...
1 vote
1 answer
922 views

I accidentally run command "chmod 555" on system directories [duplicate]

I accidently ran sudo chmod 555 / and now all users have lost access to the server Error: Last login: Thu Oct 18 16:50:55 2023 Could not chdir to home directory /home/User1: Permission denied /bin/...
4 votes
1 answer
1k views

Discrepancy with the output of `ls -al` and `getfacl`

I have run the following script to set permissions into /etc/nginx #!/usr/bin/env bash sudo chown -R root:root /etc/nginx sudo chmod -R 0750 /etc/nginx sudo setfacl -Rbk -m g:baa:rwx /etc/nginx sudo ...
17 votes
7 answers
5k views

Can we prevent a command from being executed for root in Linux?

There is this script that is difficult to read and debug. Somewhere in it, it has commands like this: sudo chmod -R 777 /$some_var/$another_var In other words, it creates a path dynamically, and then ...
24 votes
4 answers
15k views

`df` command throws error on /run/user/1000/doc/ folder

When reviewing my daily logwatch report, I noticed a new df error this morning. I noticed the unusual error at the top of the df listing. $ df (when run manually from my own account) df: /run/user/...
0 votes
0 answers
206 views

How to give a permenant permission for a disk?

I have hdd that has been mounted to a new folder Backup that I created in /media /dev/sda1 15T 28K 14T 1% /media/Backup But I am not able to create any folder and the permission is as ...
4 votes
1 answer
16k views

How do I set permissions to use Docker with my normal user? [duplicate]

I use Ubuntu 20.04 and I use docker to run images. When I installed and ran the docker command for the 1st time, the following error occurred in the shell. Got permission denied while trying to ...
21 votes
1 answer
46k views

Understanding chmod Symbolic Notation and use of Octal

Many new users make mistakes (or have misunderstanding) while applying chmod on files or directories, because of a lack of informative knowledge of: Symbolic notation for ugo and rwx Use of octal ...
1 vote
1 answer
11k views

Python IOError: [Errno 13] Permission denied in ubuntu?

I want to write string character to file, but i get error like this IOError: [Errno 13] Permission denied: '/python/add.txt'. how to solve this? this is my code q = open('/python/add.txt','r') a = ['...
0 votes
0 answers
69 views

Can't save or download data to USB memory stick

I normally use Windows on my desktop but like to experiment with Linux. I've tried several distros and different desktops. I'm currently using Ubuntu with Cinnamon but my problem applies to all other ...
0 votes
2 answers
1k views

Cannot write to external WD hard drive - Ubuntu Server 16.04

I am compelled to add a new thread as a million people have some other variant of my problem but I cannot seem to find help in their threads. I have tried a dozen things and more, but nothing works. ...
2 votes
1 answer
3k views

How do I change the default permissions of home directories created with adduser?

How can I change the default chmod of new home directories (created with adduser)?
14 votes
5 answers
83k views

Permission denied on ~ even though owner listed as me

Somehow, I managed to chmod and chown my ~ into oblivion. When I attempt to login through the shell, I get bash: ~/.bashrc : Permission denied Even after (as root) I've run chown -hR nroach44 /...
3 votes
3 answers
7k views

is it possible to create symbolic links on exfat filesystem?

I cannot even change permissions with chmod 777 that on one hand returns no error but on the other does not change the permissions either. File system is exfat. But my issue is inabililty to create ...
0 votes
0 answers
35 views

Permission on the main folder isn't reflected on the sub folders

I have assigned a folder(MF) to a group (ENG). This group has read, wright and execute permissions to the folder MF. However, MF has sub folders in it. Some sub folders do not list the ENG group to ...
0 votes
1 answer
45 views

Giving specific rights

I have the directory called 'sales' and 2 groups called 'Sales' and 'HRM'. As shown below, I have a list with all directories, and connected groups. Without changing the directory's group, i need to ...
1 vote
2 answers
1k views

How to disable internal Wi-Fi hardware and use Wi-Fi from USB adapter?

I'm Using Ubuntu 17.04 on an old LG laptop. My goal is to disable the internal Wi-Fi (since it is old and slow), and use my USB Wi-Fi adapter to obtain better Wi-Fi. However, some errors occur when I'...
0 votes
0 answers
460 views

I cannot rm -rf this directory Permission denied even though I have perm WSL2 ubuntu

So there is this location ~/.local/share/nvim/mason/.packages for mason to properly install packages it apparently needs to be able to remove stuff within this folder however my user doesn't have perm ...
0 votes
0 answers
18 views

Restoring correct file permissions for /var/ [duplicate]

Whilst running some chmod commands for Oxid 6, I made the rookie mistake of not double checking what was written fully and managed to chmod 777 /var -R as part of my command How can I restore the ...
0 votes
1 answer
363 views

Will I break things if I use "sudo chmod -R u=wrx [user]"?

I have multiple users and some have access to files of other users, I want to make sure they can only access the files and folders I set up. So I gave certain folders a public subgroup chown [...
165 votes
10 answers
312k views

How do I use 'chmod' on an NTFS (or FAT32) partition?

I have a script that I need to execute on an NTFS partition. The script's permission is set to 600. I attempted to modify the permissions by running chmod 755 script.sh, which doesn't report a ...
0 votes
1 answer
264 views

nftables.conf - file permissions

after the plain installation of nftables (ubuntu server 22.04) the permissions of the /etc/nftables.conf file are set to 755 (-rwxr-xr-x). i cannot believe that it's necessary that anyone has read and ...
2 votes
3 answers
11k views

How to solve this error `sudo: /usr/local/bin/sudo must be owned by uid 0 and have the setuid bit set` without reinstalling ubuntu?

TLDR: I am running Ubuntu 18.04 with i3 and I messed up my permissions. Whenever I run a command with sudo, I get this error message, sudo: /usr/local/bin/sudo must be owned by uid 0 and have the ...
1 vote
0 answers
9k views

sudo chown command fails to give ownership to user account [duplicate]

I have tried running: sudo chown dendy /mnt/storage1/ which returns: chown: changing ownership of '/mnt/storage1/': Operation not permitted I have also tried: sudo chmod 777 /mnt/storage1/ which ...
1 vote
2 answers
3k views

Give read only access to every user for a folder

I am the owner of directory mydir. I don't have root access. How can I give only read access to someone so that they can create a local copy of mydir? Edit: ChatGPT tells me chmod -R o+r mydir should ...
6 votes
4 answers
3k views

I accidentally typed sudo chmod -R 777 to /var insted of /var/www

I accidentally typed sudo chmod -R 777 to /var insted of /var/www so now I cannot open some applications like Skype or Ubuntu Software. Is there any way to fix this?
0 votes
1 answer
632 views

Set file permissions, exclude folder - doesn't work with chmod (works with chown?)

I want to change file permissions and exclude a folder and it's contents (or only the contents is okay too). It doesn't seem to work the same way as with chown - beause with chown I can change owner ...
0 votes
0 answers
232 views

EXT4 file, read and write inside ext4

I'm trying to modify .apk file inside ext4 file. I used mount to mount ext4 file and chmod to gain write permissions. If I mount, chmod, dont make anything else, chmod back to original permiossions, ...
0 votes
0 answers
157 views

Give permission to other users to access disk

I created a new disk and mounted it and made entries in fstab file but the disk can only be accessed by the root user.How to 1.Give permission of read and write to the disk for other users 2.Give ...
0 votes
0 answers
371 views

Problems moving files to a samba share: permissions and ownership not persistent

I have samba running on a Ubuntu 22.04 machine so I can share an specific directory with another Ubuntu 22.04 client machine. This directory on host has no files on it. Samba config on host is as ...
8 votes
1 answer
1k views

Any recover from sudo chmod 600 / [duplicate]

I was configuring ssl certificate on server and while following documentation I accidentally pasted terminal command without checking. sudo chmod 600 / usr/local/nginx/ssl/my-ssl.key It immediately ...
0 votes
1 answer
203 views

Need help after setting my /etc folder to chmod 777 [duplicate]

So I did the really dumb CARELESS action of running sudo chmod -R 777 ./ while in the etc folder. I can’t ssh into my server or anything now. I feel like an absolute idiot ofcourse because this could ...
1 vote
1 answer
1k views

how to chmod a dir from root's crontab

Root's crontab -e has the lines @reboot mkdir -p /tmp/vimbackups @reboot chmod 777 /tmp/vimbackups @reboot anotherCommand After boot, the directory has been made, but it still has the default 755 ...

1
2 3 4 5
12