Questions tagged [chmod]
The `chmod` command is used to adjust file permissions to read, write and execute for the owner, group and others.
97
questions
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 ...
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 ...
53
votes
2
answers
61k
views
How do file permissions work?
Can you explain briefly the main concepts and command line tools used to manage file permissions?
18
votes
6
answers
84k
views
How to fix sudo after "chmod -R 777 /usr/bin"?
I entered chmod -R 777 /usr/bin and now sudo is not working.
It says sudo must be setuid root.
Some advice online said to run chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo.
On entering ...
68
votes
5
answers
336k
views
Changing permissions on serial port
I'm using the Arduino IDE in Ubuntu, and am having issues with the serial port. It has worked in the past, but for reasons that may be unnecesary, I felt the need to change the ownership of some of ...
112
votes
6
answers
488k
views
Use chown to set the ownership of all a folder's subfolders and files?
How can I use the chown command to change the ownership of all a folder's subfolders and files?
56
votes
4
answers
16k
views
Why does chmod 777 -R / leave the system unusable?
I'm only granting permission to all to do anything but why does the system crash by giving permissions only? I'm only modifying the permission not changing the files.
48
votes
5
answers
212k
views
default permissions for /var/www
I was trying to open a file and write to it with PHP at /var/wwwfolder
but it wasn't working so I did
sudo chmod 777 /var/www
now I want to set the permissions for /var/www to the default.
what are ...
10
votes
2
answers
12k
views
Cannot modify files installed by `snap`
I have installed a package using snap and I need to modify one of the files but when I try to change its ownership or permissions, I always get the following message:
sudo chmod +x ./my_file.js
chmod:...
37
votes
2
answers
150k
views
Why don't I have a password for "su"? Problems with "sudo"
I have installed Ubuntu using the GUI, giving myself a password and everything. I do not intricately remember the process. However, what worries me is that I don't know the following password:
$ su
...
16
votes
5
answers
68k
views
How do I make an entire directory executable?
I have an entire folder dedicated to python scripts.
I'm tired of doing chmod on every new python script that I write.
Is there a way to make every file inside my folder executable if it is a python ...
9
votes
2
answers
10k
views
How can I recover from chmod -R a-wrx / command? [duplicate]
Today I ran sudo chmod -R a-wrx /. Now nothing is working. Can anyone help me recover my system?
43
votes
7
answers
28k
views
Why can I modify a read-only file?
Short Question:
Why can we manipulate a read-only file in Vim using : + w + q + ! even without being an administrator?
Long Question:
I have a text file (myFile.txt) which is read-only for everyone:...
8
votes
2
answers
13k
views
User Rights letters to numbers
I am having Problems converting user rights. I want to assign the following rights to certain files/folders but dont know hat to translate them into a format which chmod will work with like chmod 755.
...
167
votes
5
answers
560k
views
'chmod u+x' versus 'chmod +x'
What is the difference between chmod u+x and just chmod +x? I have seen a ton of tutorials that say to use u+x to make scripts executable. However, omitting the u doesn't seem to have any effect.
10
votes
4
answers
60k
views
Error after sudo-ing "sudo: must be setuid root"
On a colleagues computer, everytime I use a sudo command, I get this error:
sudo: must be setuid root
I tried various things mentioned on the internet, like changing the permissions to 4755 from a ...
8
votes
3
answers
38k
views
Default file permissions for php user www-data
I have a php installed on my ubuntu machine. The web root is /var/www
I set the permissions for this folder like so:
sudo chown -R ftpuser:www-data /var/www
ftpuser is the user I set up so I can ...
4
votes
3
answers
9k
views
Root directory '/' locked after using chmod
I accidentally used
sudo chmod 3 /
which gives a execute and write permission to the root directory, while deleting the read permission. How can I recover from this, I cannot even use sudo now.
108
votes
7
answers
359k
views
What is the difference between "chmod +x" and "chmod 755"?
When it comes to making a file executable what is the difference between chmod 755 and chmod +x and when would I use which? I so far have only used chmod +x and I just read something and it used chmod ...
94
votes
3
answers
837k
views
What does "chmod +x <filename>" do and how do I use it?
I want to write the Ubuntu analogue of a "batch file" (a shell script). But I don't know how to use chmod +x filename command to make it so that the script can be run. Nor do I know where to use it.
32
votes
1
answer
116k
views
File permissions won't change
sorry fresh user. I installed about 9 days ago and had issues with Unity disappearing which took 5 days of headaches to fix. It never did fix, I reinstalled.
I set up Plex (media server) and while ...
24
votes
2
answers
16k
views
What is the first number for in a 4-number chmod argument (such as `chmod 4555`)?
When I install a program, it recommends me to do chmod 4555. Okay, i know about values if I just use three numbers. For example
chmod 555 test-file
will give
-r-xr-xr-x
4 for write, 2 for read and ...
14
votes
2
answers
15k
views
Can't make a file executable
I'm using Ubuntu 12.04 64bit and I'm trying to make a file executable, but when I check the "Allow executing file as program", the check mark appears then disappear spontaneously.
Thank you.
4
votes
2
answers
34k
views
How to repair "sudo: /etc/sudoers is mode 0640, should be 0440?"
Why might sudo chmod -R a+w * cause
sudo: /etc/sudoers is mode 0640, should be 0440 sudo:
no valid sudoers sources found, quitting
and how might it be made to work?
2
votes
2
answers
1k
views
How can I change a set of files Permsissions from Root to user
I copied a set of BlueJ files from /usr/share/doc/BlueJ to a ~/BlueJ directory however the files in folders are set to root permission and read only I need to be able to read/write them.
So in BlueJ ...
68
votes
6
answers
66k
views
What is the main difference between chmod and chown?
In some examples, I saw that some used chown instead of chmod. I do not know where to use chmod and chown. Please explain to me the difference between them, when and why I should use either.
44
votes
3
answers
125k
views
Copy files without losing file/folder permissions
How can I copy files/folders from an ubuntu computer on a ext4 filesystem to another ubuntu computer which also is on an ext4 filesystem, using a usb stick which uses a vfat filesystem without losing ...
18
votes
1
answer
75k
views
Fix permissions of server after accidental chmod [duplicate]
While trying to debug a mail server, I typed:
chmod -R 777 /
instead of:
chmod -R 777 .
and the icing on the cake, due to me forgetting I had changed a script I use to sign in to fix something, I ...
11
votes
1
answer
5k
views
Strange behaviour of 'sudo chmod -rwx': Does not remove group write permissions
I just ran the following command in a directory with several files, some owned by root, some by a normal user. I got a strange message:
$ sudo chmod -rwx *
chmod: example-file: new permissions are ---...
8
votes
4
answers
207k
views
bash: ./install.sh: Permission denied installing intel fortran 2011
I am trying to install Intel Fortran Composer 2011. When I try to command ./install.sh it gives an error:
bash: ./install.sh: Permission denied
I tried some ways to get pass this.
Tried; sudo ./...
8
votes
2
answers
49k
views
How can I change permissions of a folder, including its enclosed files and subdirectories?
I need to recursively change the permissions of all folders, sub-folders and files from within ~/.local/share/Trash/expunged Does anyone have a clue or idea on how to do this?
I have tried following ...
4
votes
3
answers
9k
views
sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700
I get error message always when I work with sudo command.
It shows always sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700.
A while ago I changed the permission of /var ...
3
votes
1
answer
191
views
Is there any way to make sure that any file created in a specific folder has a certain group as owner?
I know that you can set a directory up so specific groups have access to it, but is there any way to set it up so that any new files created in it automatically have a specific group as the group ...
2
votes
1
answer
677
views
My newly added user cannot write to folder
Suppose I installed ubuntu with the user usr1 then I added usr2. I then create a group grp1 where this 2 users are added. A folder is owned by usr1 and has group grp1. But when I login as usr2 I ...
1
vote
2
answers
5k
views
Setting files and directories to match umask setting recursively
Is there a way to go into my home directory and recursively set files and directories to match my umask setting? The issue is, way back when I started using linux, I didn't understand permissions. In ...
1
vote
2
answers
3k
views
Ubuntu took away permissions from my Data partition
The pangolin has struck again. The bug of the day for today is Ubuntu taking away my permissions on my Data partition (NTFS). One moment everything worked fine, the next moment I couldn't chmod ...
1
vote
2
answers
708
views
Accidentally ran command, now don't know what to do
Accidentally ran command
sudo chmod -R o+x /home
on my Ubuntu 12.10.
Now what me to do? is that dangerous? I have no backup of partition, so I think this command is not reversible. SO me to ...
1
vote
1
answer
3k
views
How to make /var/www/html same as my /var/tmp directory?
I am using one software, who can save files to /var/tmp but not in /var/www/*.*.
I did applied chmod -R 777 /var/www. But still it can write to /var/tmp but not /var/www
How can I resolve this? (I ...
0
votes
1
answer
577
views
Repair filesystem permission
I accidentally executed
sudo chmod -R 777 /
I was actually trying to change a specific folder permission recursively, btw i did stop the command before it changed everything.
But now, i can't ...
0
votes
1
answer
3k
views
Need to give permissions to /tmp/cache and /tmp/templates_c but can't find them
When I open my website it shows me this:
The following directories must be writable by the web server:
tmp/cache
tmp/templates_c
Please correct by executing:
chmod 777 tmp/cache
chmod 777 tmp/...
0
votes
1
answer
4k
views
Permissions messed up in home folder
Despite the fact that I didn't run any chmod or chown commands, I seemed to have lost the ability to cd into some folders in my home directory.
So I ran according to various answers on this forum ...
55
votes
2
answers
247k
views
How can I check the folder permissions in ubuntu server 12.04?
Right now, I know that I can change permissions for example with:
sudo chmod 550 directory
I wonder how I can check the actual folder permission.
41
votes
2
answers
64k
views
Command to perform a recursive chmod to make all .sh files within a directory executable?
Trying to perform a recursive chmod on all the .sh files in a directory to make them executable
29
votes
1
answer
116k
views
How to make the newly created files inherit the directory's permissions...? [duplicate]
I need to give permission to a directory in such a way that, the newly created files should inherit the same permissions as the directory.
You may find a duplicate for this question, but it doesn't ...
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 ...
17
votes
3
answers
45k
views
What are the default permissions of directories in home (Desktop, Downloads, etc.)
I accidentally ran chmod 777 * in my home folder and it changed all the directory permissions (but not for the files).
How can I undo this?
14
votes
1
answer
8k
views
Files are read-only after copying over samba
I used to copy files from one system to another system via samba. How ever I am getting the file only in read only mode. What i am doing now is i used to change the file permission after transferring ...
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 /...
11
votes
0
answers
562
views
What is the difference between "chmod +x" and "chmod a+x"? [duplicate]
What is the difference between chmod +x and chmod a+x?
I know both of these commands make a file executable but what is the difference between these two commands?
9
votes
1
answer
81k
views
Change permissions to a specific user in Ubuntu 12.04 [closed]
How can I change the permission (555 or 755) to a user in a specific folder in Ubuntu 12.04.
I used this command, but it didn't work
sudo chown -R username:group directory
Thanks,