Bash SSH在所有文件中使用特定名称更改CHMOD?
我有多个Joomla!地点。如何使用bash SSH搜索所有“configuration.php”文件中的CHMOD并将其更改为444?使用以下方法:Bash SSH在所有文件中使用特定名称更改CHMOD?,bash,ssh,chmod,Bash,Ssh,Chmod,我有多个Joomla!地点。如何使用bash SSH搜索所有“configuration.php”文件中的CHMOD并将其更改为444?使用以下方法: find /path -type f -name configuration.php -exec chmod 444 {} \; 您还可以传递多个路径进行查找:find/path1/path2…使用以下方法: find /path -type f -name configuration.php -exec chmod 444 {} \; 您还
find /path -type f -name configuration.php -exec chmod 444 {} \;
您还可以传递多个路径进行查找:find/path1/path2…
使用以下方法:
find /path -type f -name configuration.php -exec chmod 444 {} \;
您还可以传递多个路径来查找:
find/path1/path2…
以下内容:
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
SERVERS=“server1.example.com server2.example.com server3.example.com”
命令_TO_RUN=“find.-name configuration.php | xargs chmod 700”
对于“$SERVERS”中的服务器
做
ssh服务器大致如下:
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
SERVERS=“server1.example.com server2.example.com server3.example.com”
命令_TO_RUN=“find.-name configuration.php | xargs chmod 700”
对于“$SERVERS”中的服务器
做
ssh服务器您可以尝试:
find / -name "configuration.php" -exec chmod 444 {} \;
(我还没有测试语法。)您可以尝试:
find / -name "configuration.php" -exec chmod 444 {} \;
(我还没有测试语法。)