Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash SSH在所有文件中使用特定名称更改CHMOD?_Bash_Ssh_Chmod - Fatal编程技术网

Bash SSH在所有文件中使用特定名称更改CHMOD?

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 {} \; 您还

我有多个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/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 {} \;
(我还没有测试语法。)