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
0answers
33 views

chmod equal sign isn't working appropriately or I misunderstand it? [on hold]

Does the equal sign in chmod command revokes unmentioned permissions? for example, the command chmod u=r file1.txt does it yield a permission -r-------- ? or it keeps the u and g permissions as they ...
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
24 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
1answer
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 ...
2
votes
2answers
32 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
25 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 (...
1
vote
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 ...
27
votes
3answers
154k 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
11 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
1k 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
26 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
32 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
171 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
26 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,...
1
vote
0answers
42 views

Why can I change permissions for a file with 000 permissions? [duplicate]

I have the following file: ------- 1 user user 0 may 26 14:07 a.tar.gz When I execute chmod 777 a.tar.gz, the file permissions change. Why does this happen, and how can I block it?
0
votes
2answers
57 views

How to change file permission of shell files

I have a directory where a lot of bash scripts or .sh files exist. I want to change their permissions to 770 (rwxrwx---) with the chmod command. How can I accomplish that?
0
votes
0answers
22 views

Can't read directory from owner with 700 permissions [duplicate]

I have directory with rwx permission for current user, but he's unable to access it, why? : sudo ls /usr/data/user-data -lad drwx------ 9 andrew andrew 4096 May 17 11:13 /usr/data/user-data : ...
1
vote
2answers
35 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
0answers
19 views

What does @ symbol mean in file permission? [duplicate]

I started encountering the following problem when I was trying to delete a set of files when I started seeing the following error on my MAC with macOs, Mojave. "The operation can’t be completed ...
41
votes
4answers
116k views

'chmod g+s' command

Hello I want to understand the role of the chmod g+s command in Unix. I also would like to know what it does in this particular context: cd /home/canard; touch un; chgrp canard .; chmod g+s .; touch ...
11
votes
2answers
1k views

Use chmod command selectively

I want to set 755 permission on all files and sub-directories under a specific directory, but I want to execute chmod 755 only for those components which does not have 755 permission. find /...
1
vote
2answers
63 views

All files or folders copied from an NTFS drive are with drwxrwxrwx rights. Can I correct this easily?

I went from Windows 7 to Debian 9, copying most of the files I'm using for my projects from an NTFS drive. I see that : all the folders I have copied are now with rights drwxrwxrwx instead of drwxr-...
0
votes
1answer
151 views

Bash script returns permission denied message

When I run this script: #!/bin/bash # internet-status.sh # ================== now=$(date +%F) cmd_output=$(nc -dzvw1 8.8.8.8 443 2>&1) logfile_string=$("[$now] $cmd_output") logfile=$("$HOME/...
1
vote
1answer
6k 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 ...
0
votes
1answer
895 views

File and Folder permissions

I have copied some data from a client's home folder to a group work folder accessed by a group in Linux. Other clients can see most of the data except some in a specific folder. When the new client ...
0
votes
1answer
177 views

Dandelion List Listener Fails

I am trying to use lisp in linux but I can not get the listener to work. Using Eclipse's menu, in help -> install new software, I installed the dandelion plugin but every time I try to run lisp code, ...
8
votes
3answers
30k views

Recursive chmod only folders or only files via script or nautilus menu?

This has been discussed before here. What I'd like to know is how to turn these: Recursive chmod only files within this folder: find . -type f -exec chmod 0600 {} \; Recursive chmod only folders ...
1
vote
1answer
51 views

stop force save on a file with read only permission

I have a script file that is currently in sudoers, and for security I want this file to be read only... so I issued the following chmod: chmod 555 test.sh Now the permissions on this file are -r-xr-...
36
votes
4answers
15k views

How to recover from a chmod -R 000 /bin?

And now I am unable to chmod it back.. or use any of my other system programs. Luckily this is on a VM I've been toying with, but is there any way to resolve this? The system is Ubuntu Server 12.10. ...
155
votes
9answers
44k views

How to chmod without /usr/bin/chmod? [duplicate]

Today I was told a tale by a Unix trainer where the root password got leaked to the students, and one of the fellas removed the execute permission from /usr/bin/chmod itself. How do you recover chmod ...
3
votes
1answer
957 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 ...
0
votes
1answer
596 views

executable files to normal files via terminal CentOS7

Today I copied some files from the shared folder (Host is a Win7) to my VM ( Guest is a CentOS7). I did this with root permissions. Then I copied th files to my apache location /var/www/html/test I ...
2
votes
5answers
5k views

Why can't I delete my files?

I copied some files from a data DVD to /home/emma (ext4), and all of the files are read only. This is what all of the files are like: emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf ...
0
votes
1answer
1k 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 ...
19
votes
2answers
768 views

What does chmod -u do?

By accident I ran chmod -u filename and it removed all of the permissions I had on filename. The man page does not reference a -u option. Experimenting I was able to conclude that it removes not all ...
2
votes
1answer
2k views

chmod doesn't work on Mac

I cannot make a file executable from the command line on a Mac. This is what I'm typing in terminal cd ./Desktop echo 'say hello' > hello chmod +x hello hello It runs when I double-click on the ...
1
vote
0answers
76 views

Does Access Control lists override group or owner permissions?

I came across the following task: Add 3 new users - alice, bob, charles Create a new group - marketing - and add alice, bob and charles to that group Create a directory - /marketing - whose owner ...
7
votes
2answers
573 views

Can't remove a file with file mode bits a+rw

I have a file with the following file mode bits (a+rw): [0] mypc<johndoe>:~>sudo touch /tmp/test [0] mypc<johndoe>:~>sudo chmod a+rw /tmp/test [0] mypc<johndoe>:~>ls -l ...
1
vote
1answer
420 views

Sync files with permissions from linux to windows?

Is it possible to sync files from a linux machine with a given permission set (for instance, 700) to a windows machine (having a ntfs partition) and still retain linux permissions? I know that copying ...
10
votes
2answers
10k views

Difference between chmod vs ACL

I understand chmod and chown and how the permission bits work, but there is another permission system inside Linux, ACL with setfacl and getfacl, so this makes me wonder. What's the difference ...
1
vote
1answer
61 views

chmod without changing stat (atime) of file

i would like to be able to chmod a directory structure without changing the atime of those (files and) directories. if i start out with a file structure like $ tree test/ test/ ├── test1.txt └── ...
1
vote
1answer
62 views

Can only write as root although user seems to have full permissions [duplicate]

I am having trouble writing to a samba share from a linux client (a Windows client can read and write just fine). According to ls -la run from the linux client, I should have full permissions: james@...
2
votes
2answers
121 views

sudo never works. I have no permissions on my computer [closed]

I want to reinstall Linux Mint..... Many commands start with sudo and then apt-get or whatever. I am never able to get past this. Typical attempt: john@john-AY022AA-ABA-p6330f:~$ sudo apt-get ...
2
votes
3answers
3k views

Permanently change permissions of /var/run/postgresql

On Linux Mint 17.0 Cinnamon Edition, I want to use /var/run/postgresql as the unix_socket_directories option for all of my postgres databases. Whenever I run the command pg_ctl -D postgres-data -o '-...
0
votes
2answers
180 views

What happens if I change chmod permissions to rrr [closed]

I want to try to change /bin/chmod permissions file to rrr but afraid to loose my machine. What happens next if I change them?
0
votes
1answer
55 views

nosuid doesn't prevent chmod u+s

I follow a tutorial to secure my /etc/fstab file. This is a certain part about /var and /tmp UUID=XXXX-XXXX-XXXX /var ext4 defaults,nodev,nosuid,noexec 1 2 UUID=ZZZZ-ZZZZ-ZZZZ /tmp ext4 defaults,...
1
vote
1answer
4k views

Readonly file and can't change permissions

There is a file with read only permissions, but even root can't chmod it. Permissions of the file: -rw-r--r-- After trying to chmod 777: chmod: changing permissions of ‘motd’: Operation not ...
16
votes
3answers
7k 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....
1
vote
1answer
314 views

Man page for file permission numbers

Is there a man page for the file permission numbers? I'm specifically talking about r = 4 w = 2 x = 1 I can never remember them and I have to google it every time I need to set permissions besides ...