July 26, 2013

Making a file readable by a script alone but not by the user


I was wondering if anyone can help me in the following case.

I am writing a CLI application in perl where the non root user would ssh to a machine and run this application. This application reads a config file which contains usernames, passwords and DSN details of databas(es) to connect to. The user provides the name of the database as an argument to the application.

Basically, I would like this config file to be read by the application alone but not directly by the user using text readers like (e.g. more, less, vi etc).

Many thanks.

Click Here!