With Fabric, according to this documentation, you can run an arbitrary shell command without having a fabfile
like this:
fab -H host1,host2 -- echo 'hello, world!'
You can also run sudo
commands in the same way, but you will be prompted for the sudo
password for every host in the list.
Is there a way to avoid having to type the sudo
password for each host, must like the Fabric function sudo()
works?
just add the following line to etc/sudoers where myusername should be the intended user who will run sudo. You should understand the security implications of doing the following. You also might want to restrict the options below to limit the commands that the user can sudo without a password.
myusername ALL=(ALL) NOPASSWD: ALL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With