LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-11-2008, 11:36 AM   #31
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116

If I am the administrator of an office network, I would often find a need to allow my users to do something while blocking them from knowing exactly what it was they were doing. My reasons commonly would be to maintain the security of the business.

Accepting that if it can be executed it can be read and understood, that does not mean at all that no attempts at security should be taken; after all, virtually all security consists of setting up a high enough wall that the intruder won't put forth the effort to climb it.

If, for instance, my typical users are clerks and accountants and secretaries, the security precautions that will be adequate against them are far easier to implement than the procedures needed to protect against a person who is an expert on the system(s) that I am running. So, obfuscating scripts could be quite adequate.

That said, in the particular case specified, I think I would use C programs rather than shell scripts, and make strace unavailable to the end users. Beyond that, I would simply keep an eye on the system logs and otherwise not worry about it.
 
Old 10-11-2008, 05:52 PM   #32
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
If they aren't to know what happens, why are they in control of when it happens? Did you consider cron? No one knows what these scripts do, making difficult to really provide a solution, mostly because scripts aren't meant to be both executable yet undecipherable by the same user. I really think you should consider remote execution.
ta0kira
 
Old 10-11-2008, 09:59 PM   #33
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
The point is that if you setup sudo to ONLY RUN those scripts, they won't actually be able to read the src...
sudo does not mean having to give the users total root access, even though some people do that.
 
Old 10-12-2008, 08:12 PM   #34
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
You can restart the computer with a "live" CD or other bootable *nix CD and access the files, anyway. What I was asking was why is it the user chooses to run the script (by typing the command in) when they don't really know what it does? If it has an inherent immediacy then the user probably will know what it does, otherwise I don't see why it can't be done remotely or via cron.
ta0kira
 
Old 10-14-2008, 10:09 AM   #35
arunabh_biswas
Member
 
Registered: Jun 2006
Posts: 92

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by unSpawn View Post
I think you should be careful with posting just "drive by" statements. Possibly you haven't read the thread well enough? The OP was asked for the reasons why and stated that so this has nothing to do with OSS but with access restrictions. Obfuscation and Shc-like encryption are weak "solutions", this question has been asked (not that frequently but perfectly searchable in LQ) and the default answer for allowing unprivileged users access still is Sudo as stated before in this thread.

Thanks unspawn for your reply,

My concern is (finally) that what if I've 200 machines and various users are using those systems. I want user to run those scripts on daily basis but can't view or edit the contents of the scripts. Few users are having root previledges on their machines. I think SUDO will not work in this case. As well as it is not possible to copy and SUDOing those scripts in each and every pc.

My only urge is that whether anybody has solution for this or not.

Thanks.

Waiting eagarly for the solution.
 
Old 10-14-2008, 03:12 PM   #36
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 arunabh_biswas View Post
Thanks unspawn for your reply
Sorry, my reply was directed at ciden.


Quote:
Originally Posted by arunabh_biswas View Post
My concern
It's highly inefficient to chose not to post full information in your OP.
 
Old 10-14-2008, 06:56 PM   #37
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Why won't sudo work? Please explain.

Do the scripts have to be run manually, can't you use cron?

If you don't want the scripts to exist on the target systems, you need ssh.
 
Old 10-15-2008, 01:42 AM   #38
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Smile

Quote:
Originally Posted by arunabh_biswas View Post
Dear Experts,

Greeting of The Day !!

I've created few shell scripts to perform administration tasks. I also distributed those scripts to my subordinates for their use.

1) I want everybody can execute those scripts in their own (differnt) systems but cannot edit or view the codes what I've wrote in those scripts. As I've seen such kind of scripts somewhere with encrypted text inside.

2) I want to make such scripts which contains coloured menus, lines, text etc. Pls suggest me the detailed procedure to do the same.

Thanks in Advance.
hey, you can use vi -x option your script. It asks for a password everytime you need to open it.
Also, it can only be viewed in "vi", not in cat/less/more.

It will be changed as in this example.
Code:
[root@eul1p3 vikas]# file OVO_Format.sh
OVO_Format.sh: Vim encrypted file data


Regards,
vIKAS

Last edited by vikas027; 10-15-2008 at 01:43 AM.
 
Old 10-15-2008, 04:48 AM   #39
arunabh_biswas
Member
 
Registered: Jun 2006
Posts: 92

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by chrism01 View Post
Why won't sudo work? Please explain.

Do the scripts have to be run manually, can't you use cron?

If you don't want the scripts to exist on the target systems, you need ssh.
Ans 1: As the users on other systems having root access, they have to run those scripts as a root user (now don't ask why they having root prevelege and all that). As a root user, he can change the sudo settings and the other thing is I've to SUDO in all the PCs. How it is possible to do it in 200 pcs.

Ans 2: Yes, user will untar the script in their pcs and run them manually.
 
Old 10-15-2008, 07:16 PM   #40
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
1. if they've got full root priv, there's no point in worrying about trying to hide stuff. They can do anything they want anyway...
2. To send a file to 200 pcs, generate a list and loop using scp. Ideally use auth-keys so you don't have to put passwords in the script. Otherwise, look at using the expect tool to ctrl the scp loop.
Possibly also look at ssh-agent.
If you do this you could also add an ssh line to run the remote script once its loaded.
Ideally of course you wouldn't be logging in as root remotely, but that's your option.
 
Old 10-16-2008, 03:33 AM   #41
arunabh_biswas
Member
 
Registered: Jun 2006
Posts: 92

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by chrism01 View Post
1. if they've got full root priv, there's no point in worrying about trying to hide stuff. They can do anything they want anyway...
2. To send a file to 200 pcs, generate a list and loop using scp. Ideally use auth-keys so you don't have to put passwords in the script. Otherwise, look at using the expect tool to ctrl the scp loop.
Possibly also look at ssh-agent.
If you do this you could also add an ssh line to run the remote script once its loaded.
Ideally of course you wouldn't be logging in as root remotely, but that's your option.
Thanks for u'r reply..

I'll simplify it more...

1) Users having root prev in their systems but they are not expert enough to do this SUDO or unencryption tasks. I just want them to execute those scripts. When they try to vi or cat or more or less those scripts, they can see the contents or even though they can see it should be visible in encoded text so that they dont edit/know the codes.
Thats it.
 
Old 10-28-2008, 12:34 AM   #42
kram2593
LQ Newbie
 
Registered: Sep 2008
Location: Carmel, NY USA
Posts: 5

Rep: Reputation: 0
Shell scripts

why not just put it on as a cron job? Or create a local shell script that calls another using at or batch. That way they wont have direct access to the script?

##########
you could complcate it more... have them run a local script that creates a "flag file" in a 'watched' directory

You as root have a cron that runs checking for that "flag file"

Once detected, your secret shell runs, and the flag is deleted at the end of the shell, then use sendmail to let them know the result
##########

Last edited by kram2593; 10-28-2008 at 12:57 AM.
 
  


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
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 06:24 AM
Editing PDF from CLI with shell scripts hamtavs Linux - Software 1 04-27-2008 12:35 PM
Restrict a Shell Script to run from a shell bharaniks Linux - Security 7 08-26-2007 10:57 PM
restrict root shell using sudo ElectroLinux Linux - Security 2 03-30-2007 05:07 PM
Editing files from shell scripts? SirRobbin Linux - Newbie 6 03-23-2004 10:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 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