In Linux, it's common practice (as defined by FHS) to create a configuration file or configuration file in /etc. For example /etc/myapp.conf
. It's up to you what format to use. License keys are often stored in this file/directory. This method requires root user access to configure the application and licence key.
The alternative approach it to keep a licence key for each user. The standard is to create a configuration directory in the user's home directory. The directory name begins with a "." (period) so that it doesn't list in a normal ls
command. For example "/home/myuser/.myapp/config.properties". Again, the license key could be written here.
The later method would allow the software to be installed by the package managers (RPM/APT) and then the license to be prompted for when a user tries to use the software. Of course, the software would be licensed on a per-user basis.