Sample Header Ad - 728x90

changed ownership on folders by user that defined in sudoers file

0 votes
1 answer
73 views
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 ( super_hola user is like super user ) super_hola ALL=(ALL) NOPASSWD:ALL but when I run the script as su super_hola whoami super_hola sudo -u super_hola ./hola_config.sh I get Operation not permitted from chmod from the script Example: chmod: changing permissions of ‘/home/darna/linux.cvg: Operation not permitted the question is why the super user as super_hola can't change the permission like root user and what to fix in my configuration in order to enable user – super_hola to do so here the user and group IDs id super_hola uid=1001(super_hola) gid=1001(pola) groups=1001(pola),982(docker) grep super_hola /etc/group docker:x:982:super_hola id -G super_hola 1001 982
Asked by yael (13936 rep)
Jan 9, 2025, 06:33 AM
Last activity: Jan 9, 2025, 09:35 AM