在多个服务器上运行命令的脚本

时间:2021-06-03 07:25:42

标签: shell script

下面的脚本保存在 userchk 下

if [ "x$1" = "x" ];then
echo command not specified exit
 fi
for x in cat /home/unixbot/aixserver;
do
echo Connecting to $x: /usr/bin/ssh -q $x "$1"
echo
 done

Aixserver 是具有 3 个主机名的服务器列表 #unixbot 是我的用户 ID 当我使用 ./userchk 运行脚本时。 “chuser account_locked=true 用户 ID” 下面出现错误


nnageesh[/home/unixbot]$ ./userchk "chuser account_locked=true nnn724"
Connecting to shton: ksh: chuser: 0403-006 Execute permission denied.
Connecting to rnley: ksh: chuser: 0403-006 Execute permission denied.
Connecting to rmoss: ksh: chuser: 0403-006 Execute permission denied.

谁能帮我解决这个问题 我需要没有root访问权限执行命令 目的是在多台服务器上执行任何命令,一个命令执行

0 个答案:

没有答案