To remove a user named ‘user’ access from a file/directory with full access to ‘other’. # setfacl -m u:user:- /path/to/file_or_directory The same can be done for a group named ‘groupname’; change u to g. # setfacl -m g:groupname:- /path/to/file_or_directory Check the permission with getfacl. # getfacl /path/to/file_or_directory # file: example/ # owner: root # group: …
Category: Linux
How to copy a file with specific permission over the network ?
To copy files with specific permissions over the network,rsync utility can be used. [root@server-source ~]# rsync --chmod=u+rwx,g+rx,o+rx testingfile user@192.168.0.2: The above command will copy the testingfile in the user’s home directory, and the permissions to the copied file would be 755.
Why no permission to execute the file after it is uploaded from Windows
After transferring the file using winscp to the Linux server, you expect to have the same permission (like 777) as its parent folder but failed to get it. $ ls -ld for-john/ drwxrwxrwx. 2 peter peter 7 Jun 27 24:09 for-john/ $ pwd /home/peter/for-john $ ls -l testing.sh ====>>transfer this file using winscp from Windows …
Log files in /var/log/ have incorrect permissions after rotated with logrotate
If Permissions of newly created log files do not carry over the custom permissions of previously rotated logs, follow the steps below. Set the permissions of files as needed before rotating them. # chmod 644 /var/log/messages cd to /var/log and confirm the change in permissions. # ls -l /var/log/ | grep messages -rw-r--r--. 1 root …
File permissions of /var/cache/yum changed to 666
To resolve this issue follow below steps. Remove /var/cache/yum directory. # rm -fr /var/cache/yum List installed and enabled repositories. # yum repolist Then execute the following command to generate an updated updateinfo.xml file. # yum check-update Once the steps above are done, Check to see if the file has the wrong permissions. # find /var …
IPA server failed to start due to change in file permissions
To resolve this issue, check the permissions of /var/log/dirsrv. The permissions should be the same as shown below. [root@server ~]# ls -laZd /var/log/dirsrv/ drwxr-xr-x. 3 root root system_u:object_r:dirsrv_var_log_t:s0 35 Jun 19 2021 /var/log/dirsrv/ Then check the permissions of /var/log/dirsrv/slapd-$domain, which should be similar as shown below. [root@server ~]# ls -laZd /var/log/dirsrv/slapd-domain/ drwxrwx---. 2 dirsrv dirsrv …
“/sys/devices/virtual/dmi/id/product_uuid” file permission changes
When the server is restarted, or a patch is installed, the permissions on the file /sys/devices/virtual/dmi/id/product uuid are permanently changed from 444 to 400.The permission 444 on /sys/devices/virtual/dmi/id/product uuid can be hard-coded by the following steps. First, check the corresponding uuid. # cat /sys/devices/virtual/dmi/id/product_uuid <should_output_your_uuid> <--This is the required product_uuid Set an udev rule by …
How to set file permissions at /var/log/sa to be 640 permanently
Here is the permanent solution. We change umask value of the “sar” logs when it is created by sysstat to change the file permissions at /var/log/sa to be 640. But after updating packages, the umask value reverted to 0022. The executables sa1 and sa2 are called by sysstat-collect.service and sysstat-summary.service. So first, copy these unit …
How to apply specific file permission on file uploaded with Linux SFTP?
The specific file permissions on files uploaded with SFTP can be set using -u(umask) for directory permission and -m for required file permission. If the permission for an uploaded file needs to be 664 and the permission for a directory needs to be 775, then the following example can be considered. Match User ftp_user ChrootDirectory …
How to change default file permissions of /var/log/wtmp?
In CentOS 7.3, permissions of the /var/log/wtmp file is handled by /lib/tmpfiles.d/var.conf, which is executed after every reboot. To change default permissions, change permissions in the following script. # cat /lib/tmpfiles.d/var.conf | grep wtmp f /var/log/wtmp 0664 root utmp - In CentOS 7.0, 7.1, and 7.2, permissions for /var/log/wtmp is managed by file /lib/tmpfiles.d/systemd.conf, which …
SSSD fails to start with error – File ownership and permissions check failed
There may be a file permission issue if you get the following error messages after starting SSSD. # systemctl restart sssd Job for sssd.service failed because the control process exited with error code. See "systemctl status sssd.service" and "journalctl -xe" for details. The error message in /var/log/messages is shown below. sssd[sssd][22160]: SSSD couldn't load the …
How to disable GPU memory notification in CentOS
The notification is part of the housekeeping plugin. The procedures listed below can be used to disable the housekeeping plugin. # mkdir -p ~/.config/autostart# sed 's|[Desktop Entry]|&nHidden=true|' /etc/xdg/autostart/org.gnome.SettingsDaemon.Housekeeping.desktop > ~/.config/autostart/org.gnome.SettingsDaemon.Housekeeping.desktop You will receive the GPU memory notification messages when the server is utilizing high GPU resources. This is normal and the notifications can be disabled …