LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-22-2013, 02:27 AM   #1
h.dilshad
LQ Newbie
 
Registered: Jan 2013
Posts: 17

Rep: Reputation: Disabled
Encription of a shell


Hi,
I am using RHEL 6.1 serverand I just make a shell to start my jboss 5.1 application server. I have to add this shell in chkconfig also to autometically start/stop. when i run it "./jboss", it is working well but when I encrypt this file with SHC program, this is giving error. here is the code of my shell:


#!/bin/bash
# chkconfig: 345 20 80
# description: jbossAS daemon
# processname: jbossAS

# /etc/init.d/jbossAS

case "$1" in
start)
echo -e "Starting Jboss Application Server\n"
#To run it as root:
/opt/jboss-eap-5.1/jboss-as/bin/run.sh -b 0.0.0.0 > /dev/null 2>&1 &

;;
stop)
echo -e "Stopping Java Application Server\n"
#To run it as root:
kill -9 `pidof java`
;;

restart|force-reload)
java_pid=`pidof java`
if [ "$java_pid" != "" ]; then
$0 stop
sleep 1
fi
$0 start
;;

status)
java_pid=`pidof java`
if [ "$java_pid" != "" ]; then
echo "Jboss Application Server is Running with PID $java_pid"
else
echo "Jboss Application Server is Not Running"
fi
;;
*)
echo "Usage: /etc/init.d/jboss {start|stop|restart|status}"
exit 1
esac

exit 0
==========================================================================
after encryption with "shc -f <filename>", after this shc give me 2 files named jboss.x and jboss.x.c when i m trying "./jboss.x status". it returns,
./jboss.x status

[1]+ Stopped ./jboss.x status
and when check process. it shows:
# ps -ef |grep jboss
root 26186 25811 0 03:24 pts/1 00:00:00 ./jboss.x status
root 26187 26186 0 03:24 pts/1 00:00:00 [jboss.x] <defunct>
root 26191 25811 0 03:25 pts/1 00:00:00 grep jboss
=======================================================================
Please guide me where i done mistake........
 
Old 01-22-2013, 06:47 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by h.dilshad View Post
Please guide me where i done mistake........
IMHO right from the start by ignoring the provided bin/jboss_init_redhat.sh (or wheel re-invention-wise other solutions provided) and using SHC without any particular reason.


Quote:
Originally Posted by h.dilshad View Post
I am using RHEL 6.1 server
...which is two updates behind. RHEL 6 has been at U3 for some time now.
 
Old 01-22-2013, 06:55 AM   #3
h.dilshad
LQ Newbie
 
Registered: Jan 2013
Posts: 17

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by unSpawn View Post
IMHO right from the start by ignoring the provided bin/jboss_init_redhat.sh (or wheel re-invention-wise other solutions provided) and using SHC without any particular reason.



...which is two updates behind. RHEL 6 has been at U3 for some time now.
Thanks unSpawn, Actually I want to hide my codes from my customers, that why I use SHC. thanks for ur support. But solved my problem with this command.
shc -r -T -f <file name>. Now it working.
 
Old 01-22-2013, 07:37 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by h.dilshad View Post
I want to hide my codes from my customers
It's not like you're "protecting" a password (see limitations) or whatever else super secret. That makes it unnecessary obfuscation (you're not thinking you can somehow bind your customers to you with such practices, right?) and that's IMHO against what Open Source Software stands for.
I don't see any valid and compelling reason to be doing this.
 
Old 01-22-2013, 08:37 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This is a good HOWTO http://www.thegeekstuff.com/2012/05/...-shell-script/, but as it says twice(!)
Quote:
, please remember that a smart person can still generate the original shell script from the encrypted binary that was created by shc.
The 2nd comment remarks
Quote:
This tool encodes, it does not encrypt. It converts to binary and provides some nice features that make it
more secure.
I agree with unSpawn, this doesn't do what you think and is not secure. I wouldn't bother.
 
  


Reply



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
password encription in php javier_ccs Programming 5 03-10-2007 11:46 PM
A C/C++ library for encription? nhydra Programming 2 05-22-2006 07:13 AM
I have a problem with mountloop and encription dirg3r Linux - Security 1 10-20-2004 03:48 AM
File encription NSKL Linux - General 2 08-31-2004 09:55 AM
Confused 128kb encription HadesThunder General 5 04-28-2004 04:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:42 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
Open Source Consulting | Domain Registration