1
I have to do following steps on several servers:
- log in with my username
- type in
sudo su -
- type in
amCLI -l 32/1 | grep Firmware
So I would like to write this all in one script, my idea was:
#!bin/bash
for hostname in DPM-BZ0201 DPM-BZ0202
do
ssh -n vneudeck@$hostname "sudo su-; amCLI -l 32/1 | grep Firmware"
done
or
#!bin/bash
for hostname in DPM-BZ0201 DPM-BZ0202
do
ssh -n vneudeck@$hostname "sudo amCLI -l 32/1 | grep Firmware"
done
Both don't work though.
possible duplicate of SSH: execute sudo command
– slhck – 2012-05-30T10:02:41.797