ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Would it be possible to restrict the daemon access using certain strings just like key generator? Like you know I can generate SHA1 string and unless and until that string is passed certain services will not start. I mean just like serial key for software but not exactly as such serial key but wanted to restirct access of services.
Can we do that or does anyone have any better idea than this? Let say I want DNS should not be started unless and until the SHA1 string is entered which is of only one time initially as well as can I keep the access for certain days and daemon will automatically stop.
Like say for 365 days and if the new SHA1 key is not entered daemon will stop automatically after 365 days.
You can configure sudo/sudoers to allow certain users to run certain commands like 'systemctl start bind'. And you can require sudo to require a password when running the commands. So -- change the user password to this sha1 sum and you have what you are describing.
Not sure what the difference between a SHA1 sum and a complex password is.
Last edited by szboardstretcher; 03-01-2017 at 11:35 AM.
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609
Rep:
Quote:
Originally Posted by szboardstretcher
Neither can a 'complex' password.
Well I didn't know that "complex password" had an official specification of being randomly generated, although "random password" can be classified within "complex password" group.
Anyway, the OP problems sounds to me like a "commercial licensing" key for customers. SHA1 or "whatever" could do the job, maybe because he already have this kind of key, but it's a detail.
Problem with what he asks is, there are a lot of chance that it will require a specialized daemon to check the key on one side, and being able to kill the "secure service" once the date is over... But anyway it sounds like a solution full of security holes which is the main problem (depending on the "criticalness" of the subject of course).
Well kinda of security key but I dont mind that is hackable or can be cracked but for at least something you know for show off reason a key is entered and then only a daemon has started. The basic idea is I can generate a file which has person name, address and duration and that file then passed through SHA1 sum which can be used to start the daemon once? Further to that probably restricting access if it does not work its OK. I can manually keep a track of it.
I have read this thread several times and am not really any closer to understanding the point of your question. It would be helpful (if only for myself) if you could provide a better, more complete description of your overall objective.
Specifically, you have focused on doing this with a bash script, but there is no obvious reason for that.
You also say it is "kinda of security key" (aka license key), but you need to provide a more complete description of how it will be deployed and used for us to understand why it is only "kinda" and not "really" a license key - you are quite vague on that point.
Is this code to be used only on your own system? If so the sudo approach might apply. If not, then how is the script/key to be distributed to others, what daemons it would affect and in what context is it to be run by those others on their own systems?
A more complete description of your actual intended use case would go a long way toward clearing up these questions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.