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.
618 questions
0
votes
1
answer
113
views
SSH Stuck waiting for reply after offering public key
Info
I have 2 remote machines, both are Linux and same OS version.
When I tried to SSH to the machine as one of the user inside via public key, machineA works but machineB get stucked after offerring ...
0
votes
2
answers
101
views
Restrict a users access to all directories but one
So there is a user that was created by root, and it pretty much has access to most/all directories on the system, we want to use this user only for ftp via lftp to read a certain file on the server ...
-1
votes
2
answers
365
views
Make script executable: chmod +x vs. a+x vs. a+rx
To make a shell script executable, there seems to exist three options:
Option 1: chmod +x script.sh
Option 2: chmod a+x script.sh
Option 3: chmod a+rx script.sh
Here are two questions.
Q1. What does ...
0
votes
0
answers
100
views
How can I set chown and chmod permanently, also for new files?
I installed texlive as usual in /usr/local/texlive/2025. When installing I typed umask 0027 prior to each command (./configure, make...), hoping that the resulting files would have root as owner and ...
4
votes
1
answer
89
views
What are the rules that determine file permissions of b after I do cp /path/to/a /p/t/b, depending on file permissions of /path/to/a and all dirs?
In Classic Shell Scripting from O'Reilly, Arnold Robbins and Nelson H.F. Beebe write the follwing example:
$ umask
023
$ rm -f foo
$ cp /bin/pwd foo
$ ls -l /bin/pwd foo
-rwxr-xr-x 1 root root ...
8
votes
5
answers
5k
views
Why is chmod 777 so bad if I'm the only user on the system?
I hear that chmod 777 is a horrible idea. However, nobody else is ever going to use my system (and this is a quite common scenario for a lot of *nix systems). Why shouldn't I allow everything?
0
votes
1
answer
85
views
changed ownership on folders by user that defined in sudoers file
I have the following simple script that changed ownership on folders
more hola_config.sh
#!/bin/bash
chown -R hola:pola /home/darna
chmod -R 775 /home/darna
in /etc/sudoers I added the following ( ...
0
votes
0
answers
32
views
Full access shared folder for two unprivileged users
I am an unpriviledged user A in the same group G as another unpriviledged user B. We want to share a directory. I want to create a shared folder, be it /tmp/shared. How do I set its rights? Seems I ...
0
votes
1
answer
251
views
Performance of chown and chmod or find and running in background in parallel?
I have up to terabytes of data (a large number of smaller files) that could contain wrong owner, group or permissions. To repair that we had a script doing
sudo -n chown -R user:group "/path"...
1
vote
2
answers
190
views
sudo chown: pemission denied even if I'm the owner [duplicate]
Could someone explain this?
john@john-pcRefs:~/pCloudDrive/someFolder$ ls -al
total 16
drwxr-xr-x 2 john john 4096 Jan 11 2022 .
drwxr-xr-x 4 john john 4096 Jan 11 2022 ..
-rw-r--r-- 1 john john ...
1
vote
2
answers
174
views
How can I safely store untrusted files? [closed]
Is it possible to store untrusted files in Linux safely? My assumption is that I would create a new user to store them and run:
chmod rw------- <directory>
However, is there anything else I can ...
0
votes
1
answer
94
views
user unable to write to media | Permission denied
I am having a problem utilizing a mounted drive
on my Raspberry Pi 2B running Diet Pi.
dietpi@DietPi:/media/dietpi/Other$ sudo chmod 666 -R /media/dietpi
dietpi@DietPi:/media/dietpi/Other$ touch text....
0
votes
1
answer
45
views
Changing Filemodes of Mounts in Linux
I was trying to use an USB-stick in Linux and it didn't go as expected:
I had already created a mountpoint (/mnt), found the device of the newly inserted USB-stick (/dev/sdb1) and mounted it:
# ls -l /...
0
votes
1
answer
118
views
What does `sudo chmod -R a=,a+rX,u+w,g+w /data` do?
What does the following command do?
sudo chmod -R a=,a+rX,u+w,g+w /data
I understand that it changes permissions, but what exactly and how?
-2
votes
3
answers
158
views
Do we need to memorize every command of Linux OS Terminal Shell? [closed]
This is a rare question that I can ask from the experts that every time I use a command for the Linux OS Terminal Shell. Do I need to memorize every command in the Command Line Interface (CLI) of ...