Encrypt source code or Provide execute only permission


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Encrypt source code or Provide execute only permission
# 1  
Old 02-13-2009
Encrypt source code or Provide execute only permission

To perform a black box testing and get users' feedback, we are planning to deploy a script in a common location and ask users to execute the script. However we do not want them to have a look at the script until the testing is done. I know this is against the open source concept, but it will be for a short period until the testing is complete.

I have server MyServer which has many users. I create a file with MyUserId under /tmp/TestScript.ksh

If I provide permissions 111, then no one is able to execute it due to lack of read permission. But I do not want to give read permission.

Only the owner must read and write the script. Is there anyway we can encrypt source code or revoke read permission for all users?
# 2  
Old 02-13-2009
use setuid

only root can execute the script without read access as root can read anything implicitly.

as root

Code:
chown root:root /tmp/TestScript.ksh

chmod 4111 /tmp/TestScript.ksh
chmod 2111 /tmp/TestScript.ksh

now log in as the other user

and execute the script.
# 3  
Old 02-13-2009
# 4  
Old 02-13-2009
Quote:
Originally Posted by rakeshou
only root can execute the script without read access as root can read anything implicitly.

as root

Code:
chown root:root /tmp/TestScript.ksh

chmod 4111 /tmp/TestScript.ksh
chmod 2111 /tmp/TestScript.ksh

now log in as the other user

and execute the script.

don't do this. This is a huge security issue. Some UNIX systems will drop setuid/setgid on shell scripts anyways.
# 5  
Old 02-13-2009
I don't have root permission anyway.
# 6  
Old 02-13-2009
Why not just compile the script using shcomp? shcomp comes with ksh93.
# 7  
Old 02-13-2009
How proficient are those users? If they're not too proficient you might be able to hide the source using uu{en,de}code, eg uuencode your script, put the coded text into a variable in another script where you decode it on start into a temporary file, which you then execute. Just make sure to delete it afterwards.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Red Hat

Use of Execute permission for folder

Hi All, What is the use of execute permission for a folder. I know "for execute a file(script file) we have to provide execute permission to that respective file".But what is the use to give execute permission to folder.Is it equal to read permission ? Regards, Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies

2. Debian

Execute permission problem

Hello, I need to install a program from a DVD. It uses a sh script called setup. root@ragnok: head -2 /media/cdrom0/setup #!/bin/sh root@ragnok: ls -l /media/cdrom0/setup -r-xr-xr-x 1 root root 4688 Nov 8 08:38 /media/cdrom0/setup root@ragnok: /media/cdrom0/setup bash:... (2 Replies)
Discussion started by: snorkack59
2 Replies

3. UNIX for Dummies Questions & Answers

Provide execute permission to a user

Hi, I have a shell script(test.sh) and need to give execute permission for this shell script to user group cobr_sftp and oracle. Could you please help as to how to give this permission. I have already given full access(777) to script test.sh. Does this mean all the users/user group can access... (1 Reply)
Discussion started by: abhi_123
1 Replies

4. AIX

Do you need execute permission to navigate to a directory?

i have a user 'bart' which does not belong to apps group (as shown below) and i want him to be able to navigate to TEST directory.. i gave him read access but he cannot get through. when i added execute permission he was able to navigate to TEST drwxr-xr-- 3 draco apps 4096 Apr... (2 Replies)
Discussion started by: chipahoys
2 Replies

5. UNIX for Advanced & Expert Users

Encrypt the password ,source it in a expect script...!!

Hello folks I have a conf file ,say 'pass.conf' ,which is storing ascii password : PASS1111. I need to encrypt this password once and store it in a file. I ,then need to write a script which would read this encrypted password and decrypts it.The o/p o this script shud be this decrypted... (8 Replies)
Discussion started by: ak835
8 Replies

6. Shell Programming and Scripting

Only Execute Permission for Others...

This might be very silly question but i dont know y is it so... i Have script I have Given the permissions in the following manner... -rwxrwx--x 1 root system 3 Jun 08 15:46 temp I want no one to see what is present in that but should be able to execute it.. but when... (3 Replies)
Discussion started by: pbsrinivas
3 Replies

7. Shell Programming and Scripting

without execute permission

how can a script run without execute permissions. when i run myscript as : sh a.sh it was working but when i say simple a.sh its not working since it has no x permission.but how about fist case? (1 Reply)
Discussion started by: Raom
1 Replies

8. UNIX for Dummies Questions & Answers

No permission to execute file

I am logged in as root and am trying to execute a file called x_cleanup_equdata but keep getting the message ksh: x_cleanup_equdataNEW: 0403-006 Execute permission denied. I did FTP this file from another server using GET, would this make the difference? I tried chmod 666 but still no luck. ... (2 Replies)
Discussion started by: markbeeson
2 Replies
Login or Register to Ask a Question