service: command not found

March 29, 2017 13.3k views
Linux Commands Debian

I am trying to setup a VPN via this tutorial:
and when I try the command: service pptpd restart it gives me this error:

service: command not found

Anyone that can help?

3 Answers

That guide was probably written for Ubuntu and since you're on Debian, you need to do this:

sudo systemctl restart pptpd

So we're just replace service with systemctl and then moving around in the commands.

I actually fixed my problem, You need to run sudo service pptpd restart because I think the service command is only a root command!

  • @Chadley

    For Debian, sudo is what you'll want to use when running commands that would normally be executed as root. On derivatives, such as Ubuntu, unless you create a sudo user yourself, it doesn't matter and you can run with or without sudo.

    That said, creating a sudo user is always advised as root should be locked and only used to initially setup the system.

Have another answer? Share your knowledge.