For more friendly access to your system, it is recommended that you allow your Ubuntu user to accesssudo without a password:
In a terminal, type the following:
$ sudo visudo
Then, add this line at the end of the file:
pi ALL=(ALL) NOPASSWD: ALL
Save your changes and exit so that they take effect.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.