I am very new to Unix so I want to apologize in advance in case my question is stupid.
I wrote a KORN script that I am planning to distribute to many users. This script contains sensitive information that the users should not see: user name and password to our database servers with payroll info.
Is there a way to hide ("obfuscate"?) parts (usernames/passwords..) or the entire script from the end users while still allowing them to execute it?
I am thinking that the right CHMOD command would do the trick i.e. something like "chmod ??? myscript.ksh...". I already did a "chmod 777 myscript.ksh" so I can run/test this script in my shell account but maybe I need to do something else? Do you guys agree? Is there a better option?
Chmod 777 means everyone can read, edit and execute the file. If you want to prevent others from reading the file, you can use something else with the chmod command, like "chmod 711 file" which will make the file executable for everyone, but only able to be read or edited by you, the owner.
What is the first line of your script? I have:
Could you post the results of a
ls -ln script
or whatever you called your script. And a
The numeric uids control access. If your current uid as displayed by "id -u" is not zero or equal to numeric uid that owns the script you should not be able to run it.
Unless the interpreter itself is suid to either root or the owner of the script. My ksh is 555.
Last edited by Yogesh Sawant; 08-11-2010 at 01:49 AM..
Reason: added code tags
I am writing a shell script for sql loader (just copy part of the code) :
For security reason, I have to put the below loginName and password into another separate file instead of in the same file of this script.
Anyone can give me a hand. Thanks.
Shell Script :... (12 Replies)
Hi,
I need to somehow pipe the password to a command and run some SQL, for example, something like echo $password | sqlplus -s system @query01.sql
To make it not so obvious, I decided to try out writing a small C program that basically just do echo $password. So now I just do x9.out | sqlplus... (8 Replies)
I am embedding bash in cpp. Can the bash code be hidden (when we cat the executable to not be able to see the bash code)
The simple code I am using:
#include <iostream>
#include <cstdlib>
using namespace std;
#define test1 "\
#!/bin/sh --posix \n\
echo... (1 Reply)
Hey guys,
I have some task from my office to lock user on the specified directory after the user logged on using ssh. And then run prompt program to fill the required information. Yeah, just like an ATM system.
My question:
How could I do those?? AFAIK I have to edit the ~./bashrc. But the... (1 Reply)
I am writing a tool that connects using SSH to a remote server and perform some actions (through root)
However - I would like to hide my operations so they will be hard to track.
I tried STRACE on the SSHD process and saw all the traffic going there so I am quite transparent to STRACE
... (1 Reply)
Hi,
I am writing a UNIX .ksh script and need to send the login password of the login id that is executing the script to a command that I am executing in the script. I don't want that password to be seen by anyone except whoever is executing the script.
Does anyone know how I can accomplish... (6 Replies)
Hi all,
i have a perl script for my users to run. My sys admin created an account for the users to log in and execute the script. They just type "perl myscript.pl" at the unix prompt to run it. Is there any way that i can hide my script? ,ie, do not allow my users to view the script. either... (5 Replies)
Hi everybody,
Do you know how to hide the text for interactive unix shell script? Just like the case for inputting password during logon.
Patrick (1 Reply)