Today i wanted to run a command, as root. I am not logged in as root for security reasons, everybody says it’s a bad idea, so I stopped loggin in as root.

Then i wanted to run something as root. I remembered the sudo command so I typed

sudo chmod +x run

Then i got:

[sudo] password for ftpuser:

And i typed the root password (I though that was the right way to do it)

Sorry, try again.

I googled and found out that I was supposed to enter my password and not the root password. I did that and i got:

ftpuser is not in the sudoers file.  This incident will be reported.

So i googled again and found out that I had to add the user to the sudoers file (/etc/sudoers). So I loggin as root, and

vi /etc/sudoers

or more right:

visudo

And pasted in there:

ftpuser ALL=(ALL) ALL

That enables ftpuser to run everything that root can run, with the sudo command.