bash script multiple servers sudo

while read HOST ; do ssh someuser@$HOST “sudo yum install -y python-ksplice-uptrack” < /dev/null; done <all_servers

Advertisements

Add to remote server fstab via script

ssh root@192.0.0.1 ‘sh -‘ < nfs_mount.sh

#!/bin/bash

mkdir -p /mnt/somedir
echo 'anyhost.domain.com:/vol/somedir /mnt/somedir nfs rw,fg,nfsvers=3,tcp,rsize=65536,wsize=65536,timeo=600,hard,intr' | tee -a /etc/fstab
mount /mnt/somedir