Script execution help needed.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script execution help needed.
# 1  
Old 03-30-2012
Script execution help needed.

I m using multiple scripts which are running on one master computer(server) and fetching records from another computers(client).

For example.

Machine A running scripts to execute code on Client machines say Machine B ,Machine C and Machine D
respectively.
Output of the script is then emailed to user.

I have added ssh keygen so that password less login and command execution can be done on client machine.


However All of the above was done using root user and now i want to use a normal user account to do the same.

What are the steps involved if i do this?

One way to do this is to create a simple user @ server end and add all the script in sudoer files against that account.
This will solve the problem of permission denied error @ server end.
But what about client end.
There are lot of different commands which are executed @ client end.Do i need to add all of them in sudoer file against the user name.
and then run
Code:
ssh -ttq sudo <command>

is there any other better alternative to this?

Hope my question is clear.
# 2  
Old 04-02-2012
Is the question too complex??
# 3  
Old 04-02-2012
If you can, write a script which you will deploy on clients.

Modify $HOME/.ssh/authorized_keys to only run that specific script :
Code:
no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/path/on/client/job.sh" ssh-rsa .. # rest of the key

You invoke the remote script on client from server :

Code:
ssh user@client

Hope that's a better alternative.
Regards
Peasant.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Screen Output Needed on every execution

Hi , A shell script being executed by multiple user in a host, but i need the output of each user who executed the script user should have screen output as well ...and unique log file name should generated on execution of script is there anyway to get it below file will overwrite... (5 Replies)
Discussion started by: amar1208
5 Replies

2. Programming

Help needed to Spawn Shell on Python and Continue Execution

def gob(url): print "\n\t Running gobuster on target." params = " -e -s '307,200,204,301,302' -t 20 -u " + url + " >> /tmp/%s/gobuster.txt" % (ip) os.system("xterm -e bash -c "tail -f /tmp/%/gobuster.txt"") for i in bflist: dirbf = "gobuster -w " + i... (3 Replies)
Discussion started by: alvinoo
3 Replies

3. Solaris

Script on Solaris spawning 2 processes for one shell script execution

Hi, I am having a shell script on Solaris 10 which has a while loop as shown below. #!/usr/bin/ksh # while do sleep 60 done Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Discussion started by: chekusi
3 Replies

4. Emergency UNIX and Linux Support

invoke one script based on previous script execution

I am database guy and not very good at shell scripts. I am seeking help to sharp my script coding. I have 5 scripts 1. master script. I use this one to call other four scripts to do database work. 2. db_backup_1 and log_backup_1 3. db_backup_2 and log_backup_2 in master script, I want to... (4 Replies)
Discussion started by: duke0001
4 Replies

5. UNIX for Advanced & Expert Users

SSH using shell script terminates the script execution

Hello, I am writing a shell script in which i do ssh to remote server and count the number of files there and then exit. After the exit the shell script terminates which i believe is expected behavior. Can some one suggest me a way where even after the exit the script execution resumes. ... (2 Replies)
Discussion started by: manaankit
2 Replies

6. Shell Programming and Scripting

ssh execution help needed.

I m writing a program to execute remote script . (display remote file content) Whenever i execute following statement it gives me an error. $command="cat /root/vm.cfg" ssh -ttq root@10.180.8.236 $command However following script work find. ssh -ttq root@10.180.8.236 cat /root/vm.cfg ... (8 Replies)
Discussion started by: pinga123
8 Replies

7. Shell Programming and Scripting

Script Execution Help Needed

Hi guys i have a script (takeconsole) as following I have moved it to /usr/local/bin to make the execution of script simpler. below are the content of the file. When i run the file by typing "takeconsole" .it always ask for entering the IP address but when i run it by using ". takeconsole".... (9 Replies)
Discussion started by: pinga123
9 Replies

8. Shell Programming and Scripting

Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test. The expect script is run... (2 Replies)
Discussion started by: twk
2 Replies

9. Shell Programming and Scripting

Script to carry-over the script execution to another system

The situation is like this. If I need to know the parameters of all the unix servers connected to a common network, is it possible to get all the parameter details of all the system with the help of a script written in one server?? Can a script be written like that ? Let me give some... (3 Replies)
Discussion started by: yuvanash
3 Replies

10. UNIX for Dummies Questions & Answers

pb with script execution

Hello, Can somebody tell me the differnce between a call of a ksh with the dot : >. script.ksh and the call without the dot: >script.ksh In my script I have writen a test for the number of parameters: if then echo 'Usage : '$0 exit 1 fi as my script doesn't need any... (3 Replies)
Discussion started by: Cecile
3 Replies
Login or Register to Ask a Question