Commit graph

10 commits

Author SHA1 Message Date
Xiaofeng Meng
ed5169b94c sshmngr: Fix session detection for OpenSSH backend
The `sshmngr` service failed to list active sessions with the `sshd`
(OpenSSH) backend because the session detection logic could not handle
the process structure of modern OpenSSH, which uses an intermediate
process for new connections.

This commit resolves the issue by:
- Improving process lookup to check for grandparent PIDs, correctly
  identifying the session process.
- Querying the correct intermediate process for network connection details.
  parse netstat output.

The new logic is encapsulated in a `get_network_info` function within the
`openssh` backend script to maintain compatibility with the `dropbear`
backend, which uses a simpler implementation of the same function.
2025-06-24 18:04:44 +05:30
Vivek Kumar Dutta
5315408948 sshmngr: Fix rpcd scripts 2024-09-12 14:30:03 +00:00
Rahul Thakur
fa9bfb428e logmngr: implement fail2ban for ssh
* handle both openssh and dropbear for fail2ban
2024-08-16 12:21:30 +00:00
Mohd Husaam Mehdi
b7d861466a sshmngr: deprecate sshmngr uci
* sshmngr uci is deprecated and so are the library functions
  related to managing that uci, sshmngr will directly interact
  with the backend uci now
* a compile time flag is introduced which tells sshmngr code
  whether dropbear backend is being used or not
2024-04-24 17:43:34 +05:30
Mohd Husaam Mehdi
df0e96d9ac sshmngr: avoid losing some backend changes on sshmngr restart
if backend uci is changed then restarting sshmngr can lead to
those changes being lost, try to preserve some of the changes

the following behaviour has been tested:

* if an extra option is set in backend UCI which is not set in
  sshmngr UCI for the same section, it will stay as it is
* manually added section in backend is not over-written
* sshmngr managed sections are properly added/modified/deleted
* option BbfSection is introduced which can be set to 0 to prevent
  sshmngr from modifying a backend section

the above works except for first boot (then sshmngr will override
backend UCI)
2024-04-18 16:35:50 +05:30
Vivek Kumar Dutta
8f159de428 sshmngr: align with bbfdm microservice install APIs 2024-04-17 03:58:46 +00:00
Janusz Dziedzic
c0a6739981 sshmngr: set MaxAuthTries=10
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2024-04-09 03:50:46 +00:00
Mohd Mehdi
b44e25c8ee sshmngr: remove bbfdm_add_service call from init script 2024-04-05 12:44:47 +00:00
Rahul Thakur
1393125ceb sshmngr: configurable backend
Make the backend daemon configurable, please note, still need
to disable dropbear as default in config and choose the backend
based on config in sshmngr
2024-04-02 16:30:49 +05:30
Mohd Husaam Mehdi
8557dbc1a7 sshmngr: add Device.SSH. support as a microservice 2024-04-01 23:16:57 +05:30