Ensuring certain processes do not show up in process table


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ensuring certain processes do not show up in process table
# 1  
Old 12-21-2016
Ensuring certain processes do not show up in process table

i've read somewhere a long time ago that there's a way to hide the workings of a script in sub functions so that when run, it doesn't show up in the process table.

is this really possible?

for instance, i need to run a command that has a password in it. and when that;s being run, it can be seen from the process table if someone is running a "watch" on the command.

how can i avoid this?
# 2  
Old 12-21-2016
Best solution is to avoid having passwords in your scripts/on the command line using public/private keys (aka ssh/sftp).

If this is not possible many commands support passing of passwords via environment variables. You could revoke all access to your script via permissions to stop users viewing script and noting the passwords. Then have a sudo rule to allow the script to be run as secured user.
This User Gave Thanks to Chubler_XL For This Post:
# 3  
Old 12-22-2016
Assuming that you want the process to not require input and depending on what you are connecting to that needs a password, there are probably better options anyway. There are at least:-
  • SSH keys as Chubler_XL suggests for ssh or sftp type connections
  • Using trusted externally validated connections, e.g. sqlplus / to connect to an Oracle database
  • Using secured configuration files to connect to mysql databases
  • Using a here document to feed the credentials in (not recommended though)

What is your target that you need to connect to?

Whatever you choose, you need to be careful that the method cannot be read and subverted for other purposes.



Robin
This User Gave Thanks to rbatte1 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitoring processes in parallel and process log file after process exits

I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues: 1. Monitor all Processes parallelly.... (5 Replies)
Discussion started by: shunya
5 Replies

2. Shell Programming and Scripting

Show running process command > 60 chars

Hi. I use this command to get list of running process: ps -ef|grep ICP|grep -v grep But how do I set the terminal to show full command? It seems that it always truncated to 60 chars no matter what options I put. e.g output oracle9 25011 24998 0 03:00:05 ? 0:00 /usr/bin/sh... (14 Replies)
Discussion started by: aimy
14 Replies

3. Shell Programming and Scripting

command to show stats of multiple processes

I am looking for a command that will show me the memory, CPU and I/O usage of multiple Process IDs ps v <pid> shows for one process ID is there something similar for multiple Process Ids? ---------- Post updated at 05:43 PM ---------- Previous update was at 05:41 PM ---------- No I am... (2 Replies)
Discussion started by: ajc212
2 Replies

4. Shell Programming and Scripting

does the pid of background process show in /proc?

Hi all, I'm reading <advanced bash scripting> and there is a example to kill a background process in a limited time,as shown below: #! /bin/bash #set -n TIMEOUT=$1 count=0 hanging_jobs & { while ((count < TIMEOUT));do eval ' && ((count = TIMEOUT))' ((count++)) sleep 1... (6 Replies)
Discussion started by: homeboy
6 Replies

5. Shell Programming and Scripting

Grep command to show only process name

Can I modify the grep command to show only a process name? Currently I run ps -efa | grep chk_web to get the following: mousr 3395 1 0 09:36:06 pts/10 0:00 sh /var/opt/scripts/chk_web.sh Can this be changed in any way to get only: /var/opt/scripts/chk_web.sh or chk_web.sh. I... (3 Replies)
Discussion started by: runnerpaul
3 Replies

6. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

7. Shell Programming and Scripting

Forking a bunch of processes and filling up the process table

I have a bash script that has been used for months here at work for doing an SSH into other machines both Linux and Solaris and running a script on the remote machine. Recently I have started to noticed that things are being left being on the maching doing the SSH. For example.... tivoli ... (1 Reply)
Discussion started by: LRoberts
1 Replies

8. Shell Programming and Scripting

Number of processes per each user in a table

Hello guys, what i want to do is to print a table with two columns (user :: #procs) on the stdout. The first column should show the users and the second one the number of processes the respective user runs. I think I need something like the count() - function in sql, don't i? Shell: Bash ... (2 Replies)
Discussion started by: tiptop
2 Replies

9. Shell Programming and Scripting

Show column names when access a table using perl

Hi all, I am using the following code in order to access the data of a table: my $sql = qq{ SELECT * FROM cc_test_cases}; $sth = $dbh->prepare( $sql ); $sth->execute( ); while(@row1 = $sth->fetchrow_array()) { # print "$row1: $row1\n"; print "@row1\n"; #print("THE VALUE... (1 Reply)
Discussion started by: chriss_58
1 Replies

10. Shell Programming and Scripting

How to show progress bar for a running process

Hi, I have 2 shell scripts ,one for taking hot backup of oracle Database while other is for progress bar. But I don't have an idea hoe should I incorporate the shell script of progress bar in my hot backup code . Please help. My shell script for hot backup is as below: ... (0 Replies)
Discussion started by: dwiravi
0 Replies
Login or Register to Ask a Question