Reputation: 13
I have multiple Joomla! sites. How to search and change CHMOD in all "configuration.php" files with bash SSH to 444 ?
Upvotes: 0
Views: 261
Reputation: 746
You can try:
find / -name "configuration.php" -exec chmod 444 {} \;
(I haven't tested the syntax.)
Upvotes: 0
Reputation: 3924
Something along the lines:
SERVERS="server1.example.com server2.example.com server3.example.com"
COMMAND_TO_RUN="find . -name configuration.php | xargs chmod 700"
for SERVER in "$SERVERS"
do
ssh SERVER <<EOF
"$COMMNAD_TO_RUN"
EOF
done
Upvotes: 2
Reputation: 4094
Use this:
find /path -type f -name configuration.php -exec chmod 444 {} \;
You can also pass more than one path to find: find /path1 /path2 ...
Upvotes: 1