Sample Header Ad - 728x90

Unix: Locating service configuration files on the file system

1 vote
1 answer
3889 views
I have a Solaris 10 box which has limited tools and commands installed in comparison to Linux distros. In addition, the tools that can be used such as grep and netstat don't have the same options and flags too. I have some services running on ports that I would like to investigate. As an example, an SSH server running on a port that is not 22. I want to be able to locate the configuration file in order to modify changes (disable weak ciphers etc.). However, when I search the entire file system for sshd.conf - I am only able to find the configuration for the default SSH server on port 22. Could anyone give me any tips on how I could locate the config file for this unique service. I have already attempted `find / -name "sshd.conf" and other possible variations but with no success. The next approach I would like to try is using tools such as netstat and svcs. I can tell that the service is running with nmap -p 5555 [ip] and also ssh [ip] -p 5555. I can also see the service is listening with netstat -an | grep "5555". However, I am unable to match it to a service listed in svcs -a. If I were able to match it with a service in svcs -a and then use svcs -x [FMRI] (for more details) - it doesn't give me the config file from where parameters are being read from - only the log file. So TL;DR: How can I locate a service's configuration file if I know the FMRI or can't map the service to an FMRI. Perhaps more simply, how can I use the output of netstat and identify what the actual service is that is listening on the device? I would imagine this would be asked often for security audits and such.
Asked by George Pascal (23 rep)
Sep 21, 2016, 08:11 PM
Last activity: Apr 17, 2025, 12:06 PM