LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-17-2017, 11:26 PM   #1
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 478

Rep: Reputation: 31
Question Encrypt shell script so it's executable but not readable


Got this situation where I need to embed a password into a shell script for the next few months. Want it so the script can't be read by anyone (even root) but is executable by everyone.

Can anyone point me to a good solution for this?
 
Old 01-18-2017, 12:14 AM   #2
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 478

Original Poster
Rep: Reputation: 31
ok how do you delete this post... figured out a way
 
Old 01-18-2017, 12:20 AM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,285
Blog Entries: 11

Rep: Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255Reputation: 3255
It is not possible to delete your post.

It would be better if you could share your solution with others here.
 
Old 01-18-2017, 09:12 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177
Whenever possible, you should find ways to authenticate your scripts without the use of passwords. In a corporate setting, for instance, LDAP can be used for (say ...) MySQL authentication and authorization. There are no passwords in the script itself. The same thing can be done for SSH and even for web sites. The control is not based on "secrets," but rather central management.
 
Old 01-18-2017, 09:15 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,301

Rep: Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214Reputation: 4214
shc is used to do something like that, but it is not really safe.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script to encrypt Micky12345 Linux - General 2 03-13-2012 07:05 PM
[SOLVED] can i encrypt a shell script HuMan-BiEnG Linux - General 18 08-25-2010 03:19 PM
Make a Bash script executable but not readable onesikgypo Linux - Newbie 7 09-08-2009 10:58 AM
encrypt shell script Swakoo Linux - Security 29 02-08-2007 08:16 PM
Make a shell script executable but not readable davholla Linux - Security 5 03-24-2004 04:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration