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


Closed    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 03-14-2017   -   Original Discussion by SkySmart
dn888 dn888 is offline
Registered User
 
Join Date: Mar 2017
Last Activity: 21 August 2017, 6:11 AM EDT
Posts: 17
Thanks: 3
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 (03-22-2017)
Sponsored Links
    #9  
Old Unix and Linux 03-15-2017   -   Original Discussion by SkySmart
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 21 November 2017, 3:22 PM EST
Location: Saskatchewan
Posts: 22,518
Thanks: 1,154
Thanked 4,273 Times in 3,946 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 (03-22-2017)
Sponsored Links
    #10  
Old Unix and Linux 03-17-2017   -   Original Discussion by SkySmart
dn888 dn888 is offline
Registered User
 
Join Date: Mar 2017
Last Activity: 21 August 2017, 6:11 AM EDT
Posts: 17
Thanks: 3
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 (03-22-2017)
    #11  
Old Unix and Linux 03-22-2017   -   Original Discussion by SkySmart
SkySmart SkySmart is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 19 November 2017, 10:22 AM EST
Posts: 897
Thanks: 735
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 03-22-2017   -   Original Discussion by SkySmart
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 21 November 2017, 3:22 PM EST
Location: Saskatchewan
Posts: 22,518
Thanks: 1,154
Thanked 4,273 Times in 3,946 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.
The Following User Says Thank You to Corona688 For This Useful Post:
rbatte1 (03-28-2017)
Sponsored Links
    #13  
Old Unix and Linux 03-22-2017   -   Original Discussion by SkySmart
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 21 November 2017, 3:22 PM EST
Location: Saskatchewan
Posts: 22,518
Thanks: 1,154
Thanked 4,273 Times in 3,946 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
    #14  
Old Unix and Linux 03-28-2017   -   Original Discussion by SkySmart
dn888 dn888 is offline
Registered User
 
Join Date: Mar 2017
Last Activity: 21 August 2017, 6:11 AM EDT
Posts: 17
Thanks: 3
Thanked 4 Times in 4 Posts
I'm interested to know more.

For instance, if a user encrypts an ascii file using the following method:


Code:
# echo hello > hello.out
#
# encrypt -a aes -i hello.out -o hello.out.encrypted
Enter key:
# ls -lrth hello.out hello.out.encrypted
-rw-r-----   1 sysadmin   other         6 Mar 28 15:00 hello.out
-rw-r-----   1 sysadmin   other        56 Mar 28 15:01 hello.out.encrypted
# file hello.out hello.out.encrypted
hello.out:      ascii text
hello.out.encrypted:    data
#

When the encrypt program asks the user to insert a key, how can root user capture the input?
Moderator's Comments:
Can I prevent a script from being viewed? Please use CODE tags when displaying sample input, sample output, and code segments.

Last edited by Don Cragun; 03-28-2017 at 01:49 AM.. Reason: Add CODE an ICODE tags.
Sponsored Links
Closed

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-08-2016 12:27 AM
how do i prevent $ from being commented out if no value is present? (Bash Script) xxxx Shell Programming and Scripting 2 01-22-2012 04:58 AM
Cron job to prevent simultaneous script tech9821 Shell Programming and Scripting 5 06-16-2010 06:02 PM
script - how to prevent in parallel run Gopal_Engg Shell Programming and Scripting 1 02-24-2010 05:24 AM
Use UNIX to track web sites viewed? tracymanusa OS X (Apple) 1 11-27-2005 02:19 AM



All times are GMT -4. The time now is 12:38 PM.