56 words
1 minute
Disabling SSH Login on the Nezha Monitoring Agent
Background
The Nezha monitoring agent ships with SSH login enabled by default. Sometimes you’ll want to turn that off — for instance, to keep attackers from getting in through it.
Disabling SSH Login on the Agent
V0
- Edit /etc/systemd/system/nezha-agent.service
Terminal window nano /etc/systemd/system/nezha-agent.service - Append
--disable-command-executeto theExecStart=line - Restart the agent
Terminal window systemctl daemon-reloadsystemctl restart nezha-agent
V1
- Edit /opt/nezha/agent/config.yml
Terminal window nano /opt/nezha/agent/config.yml - Set
disable_command_executetotrue - Restart the agent
Terminal window systemctl restart nezha-agent
Disabling SSH Login on the Nezha Monitoring Agent
https://www.mihouo.com/en/posts/server/close-nezha-agent-ssh-login/