1

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 .

the_Strider
  • 157
  • 1
  • 1
  • 7

2 Answers2

3

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

shcherbak
  • 289
  • 1
  • 12
-1

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

sudo yum remove openssh-server

sudo yum install openssh-server