shell script expert
$10-30 USD
Pagado a la entrega
I have below script which will basically run various commands that i enter inside the quotes.
This needs to execute now as "root" user , currently it run as "bob" user which has "root" privilages by becoming root user with sudo su
Please let me know if you can make it without changing below code much.
#!/bin/bash
tmpdir=${TMPDIR:-/home/cloud-user}/output.$$
mkdir -p $tmpdir
count=0
while IFS= read -r host; do
ssh -n -o BatchMode=yes -q -o "StrictHostKeyChecking no" -i /home/cloud-user/keys/[login to view URL] ${host} 'hostname -f & command1 & command2' > ${tmpdir}/${host} 2>&1 &
count=`expr $count + 1`
done < '/home/cloud-user/servers/[login to view URL]'
while [ $count -gt 0 ]; do
wait $pids
count=`expr $count - 1`
done
echo "Output for hosts are in $tmpdir"
exit 0
NOTE:
on all hosts "bob" user exist and he can become root on all hosts without password
Script need to execute on 500 nodes all at once
All commands which are in quotes needs to be executed as "root" user. ('hostname -f & command1 & command2' )
on local host, it currently runs as my id "bob"
Nº del proyecto: #23377372
Sobre el proyecto
14 freelancers están ofertando un promedio de $29 por este trabajo
I am good in shell script along with automation and development, please let me know if you are good to award this project to me
Hi. I can help you without problem. I can provide you with a basic bash script converting required user to root using sudo. Be advice, you need to configure sudo firts for required user. Open to questions
Hi, Try replacing 'hostname -f & command1 & command2' with 'hostname -f & sudo command1 & sudo command2'. If it works, please feel free to assign the project to me and pay the milestone :-). I've put $10 because the f Más
Hello. I have some experiences for similar projects with yours. I have rich experiences as a Python developer for 12 years. I have developed 250+ projects based Python and 7 of them are used for huge companies like Na Más
Dear Client, How are you? I can start now. I am very interested in this project. I have rich experience in python with over 8 years of experience and very strong in this field. I can deliver you a wonderful result as y Más
Hello, I request you to award me this task since I am experienced with Linux bash scripts. I will provide documentation where required.
Hi, You don't need to change a single line in your code. While running your script itslef, you can define with which user your script should run. It is not even 5 mins jobs, you basically need to know the right comm Más
Hi , I have good experience to shell scripting. I would like to work on this project. Thanks. Brossfl.