To resolve this issue, create the file list in another task, or use a shell or command module to execute a copy command. Local evaluation is performed on the with_file_glob attribute. When a path to a remote source is desired, the file glob expansion will be invalid. This issue applies whenever a remote source is …
Is there an easy way to change the permission of /var/log/cups to 644 and be persistent?
To change the permissions for the CUPS log files (access log, page log, and error log), add or change the LogFilePerm directive in /etc/cups/cupsd.conf (CentOS 6 and earlier) or /etc/cups/cups/cups-files.conf (CentOS 7 and later) to the desired numeric permissions. For instance, to let anyone read the log file, set. LogFilePerm 0644 Restart the CUPS service …
A file cannot be copied, read, written, or removed even by root
The root cannot write to or read from regular files even with those specified permissions. # cp the.file /tmp/the.file.bk cp: cannot open ‘the.file’ for reading: Permission denied # lsattr the.file lsattr: Permission denied While reading flags on the.file # rm -rf the.file rm: cannot remove ‘the.file’: Permission denied # file the.file the.file: regular file, no …
How to change default permission of /var/log/messages
It is best to only change $umask once and use $FileCreateMode instead to change the mode. Add the $umask near the top of the configuration file, such as at the top of the GLOBAL DIRECTIVES section of /etc/rsyslog.conf. Make sure it is set before any $IncludeConfig directives. Use $umask 0022 to stop files from being …
Is it okay to change the permissions of files and folders inside /proc
The files in /proc directory are world-writable in CentOS. What are the effects of these permissions on the security of the Linux server? Is it ok to change their world-writable permissions? Executing the following command lists world writeable files. find / -type f -perm -002 -ls | more The files in the /proc directory are …
Is it safe to change the default permission of /var/log/btmp
Failed login attempts are logged in /var/log/btmp file. For security reasons, it is recommended to set default permission 0600 on the /var/log/btmp file. Secondly, the file should be owned by the root user. Some services like sshd do not work, if the default permission of the file is changed. The following error may be observed …
Ansible Sample Exam Questions and Answers For RHCE EX294

Introduction This article has practice questions for ansible, which can be very useful to prepare for your Red Hat Certified Engineer exam. LAB Your Lab should consist of one controller node and four managed nodes. If you think your laptop does not have enough MEMORY or storage to run 6 VMs, you can order VPS …
Could not change permission for files under /boot/efi in CentOS 6, 7, 8
The vfat filesystem used by /boot/efi is the cause. Despite not having the concept of permissions itself, the vfat filesystem can be mounted under Linux with any set of permissions. Unable change permission for /boot/efi/EFI/centos/grub.conf on CentOS 6 as shown below. [root@centos6 centos]# ls -ltr total 248 -rwx------ 1 root root 247570 Jan 22 2011 …
How to restrict access to a specific user when file or directory permission is 777?
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: …
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 [email protected]: 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 …