You're explicitly running a command in sudo: execute :sudo, 'whoami'
, why are you surprised that it uses sudo?
As explained in the documentation that you quoted, setting the :use_sudo
option to false will tell Capistrano not to use sudo when doing certain operations. If you execute sudo whoami
though it's not going to modify your command.