Similar to the last post, this is another one that fits into the “old brain” category.

When executing commands as another user, sudo is your friend.

You must authenticate, but entering the password repeatedly in day-to-day work is tedious.

sudo can be made passwordless by editing the sudoers file with visudo.

Run:

sudo visudo

which opens your favourite editor.

Add the following line at the very bottom (important):

<username> ALL=(ALL) NOPASSWD:ALL

This allows the user <username> to execute commands as the root user.