Unix/Linux Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Can I prevent a script from being viewed?

UNIX for Advanced & Expert Users


Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 1 Week Ago
dn888 dn888 is offline
Registered User
 
Join Date: Mar 2017
Last Activity: 17 March 2017, 9:51 PM EDT
Posts: 9
Thanks: 0
Thanked 4 Times in 4 Posts
Quote:
Originally Posted by Corona688 View Post
But then they could only run the program if they knew the passphrase - either that, or include the password in the program, which leaves you with the same problem!
His question was to prevent the file being viewed. So I assume the file owner is only user that should have access to it.
The Following User Says Thank You to dn888 For This Useful Post:
SkySmart (2 Days Ago)
Sponsored Links
    #9  
Old Unix and Linux 1 Week Ago
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 24 March 2017, 6:31 PM EDT
Location: Saskatchewan
Posts: 22,008
Thanks: 1,063
Thanked 4,127 Times in 3,819 Posts
Quote:
Originally Posted by dn888 View Post
His question was to prevent the file being viewed. So I assume the file owner is only user that should have access to it.
I'm not sure what the point of the password is then, if chmod is good enough.
The Following User Says Thank You to Corona688 For This Useful Post:
SkySmart (2 Days Ago)
Sponsored Links
    #10  
Old Unix and Linux 1 Week Ago
dn888 dn888 is offline
Registered User
 
Join Date: Mar 2017
Last Activity: 17 March 2017, 9:51 PM EDT
Posts: 9
Thanks: 0
Thanked 4 Times in 4 Posts
Because if you chmod it, the root user would still be able to access it?
The Following User Says Thank You to dn888 For This Useful Post:
SkySmart (2 Days Ago)
    #11  
Old Unix and Linux 2 Days Ago
SkySmart SkySmart is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 23 March 2017, 4:15 PM EDT
Posts: 859
Thanks: 704
Thanked 3 Times in 3 Posts
i think i found online solutions for this.

shc and enscryption

shc turns the script into binary. which is really appealing to me. but im reading reports that the content of the script can be easily viewed if someone ran ps -ef or something. on the running script.

i really, really appreciate the help that all the posters in this thread have provided. i really do! im going to thank each and every post.
Sponsored Links
    #12  
Old Unix and Linux 2 Days Ago
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 24 March 2017, 6:31 PM EDT
Location: Saskatchewan
Posts: 22,008
Thanks: 1,063
Thanked 4,127 Times in 3,819 Posts
As I posted last week:

Quote:
This extremely common question always has the same inescapable conclusion.

Moderator's Comments:
Can I prevent a script from being viewed? If your database/machine/client can decrypt it at will without secrets -- so can anyone else.


Even if you shc it that doesn't prevent people from, say, copying it to a different machine without your permission, somewhere they can control what shell is used, so as to extract the contents.

Yes, but --

Encryption does not work that way.

But what if --

Encryption does not work that way.

Maybe if it --

Encryption does not work that way.

To prevent people from reading your scripts/passwords, chmod.

To prevent people getting access to something which reads the scripts/passwords, sudo.

To prevent root from getting at it... You're out of luck.
Encryption really, really, really doesn't work that way, no matter how far down the rabbit hole you go.
Sponsored Links
    #13  
Old Unix and Linux 2 Days Ago
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 24 March 2017, 6:31 PM EDT
Location: Saskatchewan
Posts: 22,008
Thanks: 1,063
Thanked 4,127 Times in 3,819 Posts
Quote:
Originally Posted by dn888 View Post
Because if you chmod it, the root user would still be able to access it?
There are no methods to protect from root, at all.

I am not speaking figuratively.

You are looking for a logical contradiction.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Any Help About this script how can i prevent client to use it ? jackmio Red Hat 1 03-07-2016 11:27 PM
how do i prevent $ from being commented out if no value is present? (Bash Script) xxxx Shell Programming and Scripting 2 01-22-2012 03:58 AM
Cron job to prevent simultaneous script tech9821 Shell Programming and Scripting 5 06-16-2010 05:02 PM
script - how to prevent in parallel run Gopal_Engg Shell Programming and Scripting 1 02-24-2010 04:24 AM
Use UNIX to track web sites viewed? tracymanusa OS X (Apple) 1 11-27-2005 01:19 AM



All times are GMT -4. The time now is 03:43 PM.