Solaris How To: Logging for FTP on Solaris 10

The svccfg command on Solaris 10 systems allow you to modify the configuration of services. Using it, you can specify how particular services are run in much the same manner you would have made changes in the inetd.conf file on older versions of Solaris.

To add logging to your ftp service, for example, you would add the -l option (logs each FTP session to syslogd) or the -L option (logs all commands sent to in.ftpd to syslogd).

To start svccfg to make a change to the settings for ftp, type the command shown below.

# svccfg -s ftp editprop

You will then find yourself in vi and starting at a screenful of settings that begin with lines like those you see below.

select svc:/network/ftp

# Property group "general"
# delprop general
# addpg general framework
# setprop general/entity_stability = astring: (Unstable)
# setprop general/restarter = fmri: (svc:/network/inetd:default)

The line you are looking for will look like the one below. What you want to do is 1) remove the # sign, add your "-l" or "-L" prior to the quotes at the end of the line and exit vi.

# setprop inetd_start/exec = astring: ("/usr/sbin/in.ftpd -a")

The next time you use ftp, you should notice that ftp runs with the additional setting:

ps -ef | grep ftp
root 28111 28134   0 14:46:41 ?           0:01 /usr/sbin/in.ftpd -l

The svccfg command can be used to change the default behavior of any number of system services. The syntax, as depicted in the example above, is:

svccfg -s <i>FMRI</i> editprop

where FMRI stands for "fault management resource identifier" and is replaced by the name of the service you are trying to configure.

You can also use svccfg to import and export service configurations. To export your ftp settings (in the form of an xml file), for example, you can use the following command:

svccfg export ftp > /tmp/ftp.export

This article is published as part of the IDG Contributor Network. Want to Join?

To express your thoughts on Computerworld content, visit Computerworld's Facebook page, LinkedIn page and Twitter stream.
Fix Windows 10 problems with these free Microsoft tools
Shop Tech Products at Amazon
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.