Reputation
6,465
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
3 48 91
Impact
~629k people reached

Mar
13
answered Allow access to one directory when all others require authorisation
Mar
13
comment Should email system be virtualized?
Virtualisation may be quickest way to balance your risk (although not your load). Strongly recommend that you don't consider Physical to Virtual (p2v) conversion if you do virtualise.
Mar
13
comment sshd running but no PID file
@ChrisS - yes. As stated above, the PID file exists after a reboot. After killing the sshd process that was running, and then starting it with service sshd start the PID file exists again. Haven't seen it disappear again yet.
Mar
7
revised sshd running but no PID file
added 2997 characters in body
Mar
7
comment sshd running but no PID file
Ok - with sshd_config using default AddressFamily (any) I only get the output showing bind to IPv6 addresses. With AddressFamily set to inet I see 0.0.0.0:22 in the netstat output. Anyway, that isn't really the problem I'm trying to resolve. I've edited your script so it captures the info you want, but I don't think it indicates any compromise of sshd.
Mar
7
comment sshd running but no PID file
Your grep expression is not returning any results. netstat -lptun | grep ":22" outputs the lines relating to port 22. It's not listening on any other ports that begin with 22.
Mar
6
revised Move HDDs to new hardware
deleted 17 characters in body; edited tags
Mar
5
revised sshd running but no PID file
added 209 characters in body
Mar
5
revised sshd running but no PID file
added 209 characters in body
Mar
5
comment sshd running but no PID file
See update in question for what is shown by netstat -lptun. The grep in your script doesn't pick up anything for port 22 for me, but I can see from netstat that it is there.
Mar
5
revised sshd running but no PID file
added 155 characters in body
Mar
5
comment sshd running but no PID file
@cjc - I'm less concerned about Monit here than I am about the general behaviour.
Feb
28
awarded  Popular Question
Feb
27
revised sshd running but no PID file
added 91 characters in body
Feb
27
comment sshd running but no PID file
error: Bind to port 22 on 0.0.0.0 failed: Address already in use. and fatal: Cannot bind any address. Not surprising since sshd is clearly running.
Feb
27
asked sshd running but no PID file
Feb
24
accepted Monit lists Apache as Not Monitored
Feb
24
comment Monit lists Apache as Not Monitored
The PID file was correct, but running monit monitor apache got it started, and now it seems to be working fine after restarting the service. I should also have tried clicking the Enable Monitor button on the web interface.
Feb
24
comment Effects of configuring vm.overcommit_memory
That would be a great function if the PID for an app was static...
Feb
23
revised Monit lists Apache as Not Monitored
added 268 characters in body