Sudo only when needed