How to Control Systemd Services on Remote Linux Server

Systemd system and services manager can be controlled using the systemctl command line utility. It enables you to manage systemd locally or on a remote Linux machine over the SSH protocol.

In this short article, we will show you how to manage systemd system and service manager on a remote Linux machine over a SSH session.

Attention: We recommend using public/private key pairs for passwordless authentication for SSH, as opposed to passwords, and also employing additional methods to secure SSH service, as explained in these guides.

  1. SSH Passwordless Login Using SSH Keygen in 5 Easy Steps
  2. 5 Best Practices to Secure and Protect SSH Server
  3. How to Block SSH and FTP Access to Specific IP and Network Range

To connect to a remote server, run systemctl with the --host or -H flag as follows. In the command below, we are connecting to the remote server as the root user and status is a subcommand of systemctl utility used to view the status of the httpd service on centos.temint.lan (remote Linux server).

$ systemctl --host [email protected] status httpd.service
$ systemctl -H [email protected] status httpd.service
Manage Systemd Service on Remote Linux
Manage Systemd Service on Remote Linux

Similarly, you can also start, stop or restart remote systemd service as shown.

$ systemctl --host [email protected] start httpd.service   
$ systemctl --host [email protected] stop httpd.service
$ systemctl --host [email protected] restart httpd.service

To end the session, simply type [Ctrl+C]. For more information and usage options, see the systemctl man page:

$ man systemctl 

That’s all for now! What follows is an assortment of systemd articles which you’ll find useful:

  1. The Story Behind: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linux
  2. Managing System Startup Process and Services (SysVinit, Systemd and Upstart)
  3. Manage Log Messages Under Systemd Using Journalctl [Comprehensive Guide]
  4. How to Create and Run New Service Units in Systemd Using Shell Script
  5. How to Change Runlevels (targets) in SystemD

In this article, we showed you how to manage systemd system and service manager on a remote Linux machine. Use the feedback section to ask questions or share your thoughts about this guide.

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

7 thoughts on “How to Control Systemd Services on Remote Linux Server”

  1. I get Permission denied (public key).

    I checked the man page for systemctl (Linux Mint Tricia) and there’s no information on authenticating using a certificate. Is there a work-around for this? Thanks

      • You can set up ssh passwordless login by using ssh-copy-id to put the public half of the ssh key pair into remotehost:/home/username/.ssh/config/authorized_keys.

        However, even when logged into the shell on the remote host, you have to use sudo to call systemctl unless there’s some way to set up systemctl so that user has access without sudo.

        I’m pretty sure that’s what the commenter was asking about, and I arrived at this page because I’m looking for the same information.


Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.