I am trying to install OpenSSh server on a fresh CentOS 7 machine , although the installation went fine but when I am trying to enable/Start, or to know the status of sshd.service using systemctl I am getting an error ,

"Failed to issue method call : Unit sshd.service is masked" .

Thank you.

I have taken every steps mentioned in this guide,and CentOS docs but I am still unable to unmask the service .


You can mask and unmask service. Masking is like disabling a service. It not only makes sure that service is not started automatically anymore, but even ensures that a service cannot even be started manually anymore. Mask command symply makes symlink to /dev/null like this:

 $ ln -s /dev/null /etc/systemd/system/sshd.service
 $ systemctl daemon-reload

Masking a service is a permanent change, much like disabling a service.

Enable service first:

systemctl unmask sshd.service

See more about systemd : systemd for Administrators, Part V by Lennart Poettering


I fix this problem after remove and install again openssh-server:

sudo yum remove openssh-server

sudo yum install openssh-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.