how to properly mask ssh server background service

jp flag

I want to mask ssh so the ssh server is disabled till I need it myself. but still want to have ssh client capabilities.

I use openssh and the service is ssh.service and its alias sshd.service

I use ubuntu 22.04

is the correct steps:

systemctl stop sshd
systemctl disable sshd
systemctl mask sshd
systemctl mask ssh
vn flag

Yes, and remember to use sudo:

sudo systemctl stop sshd
sudo systemctl disable sshd
sudo systemctl mask sshd

You don't need the 4th line, since ssh and sshd are aliases.

Usermaxn avatar
jp flag
did all 4 lines and it worked anyway thanks for the answer
Usermaxn avatar
jp flag
would the 4th line cause any problems?
Artur Meinild avatar
vn flag
No, but it does the same as line 3.
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.