from fabric import Connection c = Connection('remote_host') # run a simple command as sudo result = c.sudo('ls /root') # run multiple commands as sudo result = c.sudo('apt-get update && apt-get upgrade', pty=True)In the first example, the `ls /root` command is executed with sudo privileges on the remote_host machine. The second example demonstrates running multiple commands (updating and upgrading) with sudo privileges on the remote_host machine. The package library used in the above code is Fabric.