Encrypt shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Encrypt shell script
# 1  
Old 07-22-2013
Encrypt shell script

Hi,

We have some scripts which will run in other project..So the requirement is that we dont want that they should see our code though they can run it. I have done some searching about how to encrypt the shell script and found SHC utillity as the answer.

Can anybody please suggest how will i do it. I tried to install it using wget command but this command is not available here. i am using solaris.

And is it dependent on the OS? What i mean here is, if i encrypt the scripts in solaris after installing SHC, will these run in HPux or Linux even though no SHC installed there?Or do you see any disadvantage of using this utillity.

Thanks in advance.

Last edited by millan; 07-22-2013 at 03:11 AM..
# 2  
Old 07-22-2013
You can just use unix permissions to make it executable only.
# 3  
Old 07-22-2013
That team works in a different server.

I tried your solution.. changed the permission to 744..after i downloaded those and put it in another server it 's default permission changed to 644 because of the umask value in that server.

So i dont think this is the appropriate solution of what i m looking for.

Anyother idea is appreciated.
# 4  
Old 07-22-2013
shc converts a shell script to a C source code and then uses the available compiler to compile it to a binary. The binary is just like any other executable and though I have not used this shc utility myself, I don't see a reason why it shouldn't work on other linux machines.

To know how to work with shc, please look into the man pages. They should be pretty comprehensive.
# 5  
Old 07-22-2013
This utillity is not available in my server..i have checked with man and which command.Can anyone please help me where to download this.
# 6  
Old 07-22-2013
# 7  
Old 07-29-2013
During installing this shc utility in solaris i am getting below error.

Code:
 
$ make
/opt/SUNWspro/bin/cc -Wall shc.c -o shc
cc: illegal option -Wall
*** Error code 1
make: Fatal error: Command failed for target `shc'

I was serching for the error, found that i have to comment out all CFLAGS definitions except below one.

Code:
 
CFLAGS = -fast -xO4 -s -v -Xa

So where can i find the file(filename and location) containing these definitions?

Or is there any alterative way to avoid this error.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Encrypt script

Hi, I have to encrypt my ash scripts on a distribution of linux with Armv5tejl Buildroot , I tried a lot of solutions but none works . Someone can help me? Thanks, Nicola (7 Replies)
Discussion started by: n.rito
7 Replies

2. Shell Programming and Scripting

Shell script to encrypt the xls file using executable jar in Linux SUSE 11.4

Dear Experts, I am an ERP consultant and would like to learn shell script. We are working on Linux SUSE 11.4 and I am very new to shell scripting. We can manually encrypt an excel file using "executable jar" through command prompt by placing the jar file & the file to be encrypted on a physical... (1 Reply)
Discussion started by: nithin226
1 Replies

3. Shell Programming and Scripting

Encrypt and decrypt the password in a Shell Script

Hello, I have the following UNIX shell script which connects to the teradata database and executes the SQL Queries. For this, I am passing database name, username and password. I don't want to reveal my password to anyone. So, is there any way that I can encrypt my password and read the... (2 Replies)
Discussion started by: ronitreddy
2 Replies

4. Shell Programming and Scripting

Encrypt and decrypt a password in shell script

Hi All, very good morning all. I am trying to connect to informatica repository by using shell script. I have written pmrep connect command in the script file. But i need to provide repository, domain ,username and password to connect. Username and password are hard coded in the script... (8 Replies)
Discussion started by: SekhaReddy
8 Replies

5. Shell Programming and Scripting

Encrypt Password file and decrypt in a shell script

Hi All, I have stored Oracle database passwords in a hidden file - .pass_file. My shell script reads the hidden file, gets the password and then logs in to the Oracle database and runs some SQL script. My requirement is: I need to provide the shell script to be executed by someone else. So,... (1 Reply)
Discussion started by: sunpraveen
1 Replies

6. Shell Programming and Scripting

how to encrypt a password in shell script

Hi, I have run the below script which is connected to db2 v9.5. There is no issue. The only problem is how to encrypt the dbpwd? #!/bin/ksh #---- Set Environment dbalias="dev1db" dbuser="user1" dbpwd="password" #---- Connect to the Database cd /opt/ibm/db2/V9.5/bin db2 "connect to... (1 Reply)
Discussion started by: lookinginfo
1 Replies

7. Shell Programming and Scripting

how to set password/encrypt a shell script

Hi, I have written a shell script in unix for my customer. Now I want to make it only execute and not to read/write. Can anybody help me how to set password protect/encript my script. Thanks Suresh (3 Replies)
Discussion started by: suresh3566
3 Replies

8. Shell Programming and Scripting

shell script encrypt a file using gpg

Hi, I have a requirement to encrypt a file using gpg with a public key. However when i encrypt a file, i get a question like 'Do you want to go ahead with unverified user?' . when i press 'y' file is encrypted. I am not able to automate this job because of this interactive mode. Could... (3 Replies)
Discussion started by: Deepakbabu
3 Replies

9. Shell Programming and Scripting

how to encrypt my shell script program in linux

for security purpose I want to encrypt my shell script program.please give me some idea immediately. I have already try SHC in my server but after using SHC server hang problem is occured. kindly provide me solution for that. akm (3 Replies)
Discussion started by: akm9999
3 Replies

10. UNIX for Dummies Questions & Answers

Shell to run query, encrypt and send email

Hello To do : 'automate the process of generating report and send it to client every 15 days after encrypting the report file' Did so far : - generate Java program to encrypt the file. - generate SQL query to run the report. Is there any body who can help me to go further ? ... (7 Replies)
Discussion started by: cub
7 Replies
Login or Register to Ask a Question