Sponsored Content
Top Forums UNIX for Advanced & Expert Users Pass Multiple Commands and Open Multiple Xterms via PSS Post 302911601 by icemanj on Friday 1st of August 2014 03:55:47 PM
Old 08-01-2014
Pass Multiple Commands and Open Multiple Xterms via PSS

Hello,

I'm attempting to open multiple xterms and run a command as an SAP user via sudo using PSSH. So far, I'm able to run PSSH to a file of servers with no check for keys, open every xterm in to the servers in the file list, and SUDO to the SAP(ADM) user, but it won't do anything else afterwards.
I've tried many combinations and I'm not sure if my options for the pssh nor the xterm options are set correctly....Here is what I have now..
Code:
pssh -i -h ectsrv -A -O StrictHostKeyChecking=no "export DISPLAY=IP address:0.0;  xterm -hold -e "sudo /path/sap_sudo.sh" "

I've tried many combinations..with and without quotes of single and double:
Code:
xterm -e sudo "cmd1;cmd2;ls;bash"
xterm -e sudo "cmd1 && cmd2"
xterm -e sudo "cmd1;cmd2; ksh"
xterm -e sudo "-tt" "cmd1;cmd2;ls;bash"

Completely stuck at SIDADM> in new windows, but it won't run commands afer...please assist!
Thanks for any feedback
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, output, and code segments.

Last edited by Don Cragun; 08-01-2014 at 05:57 PM.. Reason: Add CODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

resize multiple xclients (xterms) on command line or programmatically?

Is there a way to resize x clients after they're started either on the command line or programmatically? I'm using Cygwin and typically start my root window, wm, and four xterms. By the end of the day they're all over the place with different sizes. I'd like to be able to enter a single command... (0 Replies)
Discussion started by: gctaylor
0 Replies

2. Shell Programming and Scripting

How do we pass multiple arguments into awk

How do we pass multiple arguments into awk : name=john age=12 now i have to pass both age and name into awk.. how to do it? like : awk -v var=... (4 Replies)
Discussion started by: abhinav192
4 Replies

3. Shell Programming and Scripting

Commands to multiple xterms

Hi, I need some help with sending commands to multiple xterms. What I do is ssh -Y to a remote box, and then open up 4 shells (csh) and on each one I run a different program in sequence -- one of them has 2, the first of which goes into the background and after you hit "enter" or "return" you get... (0 Replies)
Discussion started by: rmoriarty
0 Replies

4. Solaris

Help with executing multiple remote commands after multiple hops

Hi SSHers, I have embedded this below code in my shell script.. /usr/bin/ssh -t $USER@$SERVER1 /usr/bin/ssh $USER2@S$SERVER2 echo uptime:`/opt/OV/bin/snmpget -r 0 -t 60 $nodeName system.3.0 | cut -d: -f3-5` SSH to both these servers are public-key authenticated, so things run... (13 Replies)
Discussion started by: LinuxUser2008
13 Replies

5. Programming

Control multiple program instances - open multiple files problem

Hello. This shouldn't be an unusual problem, but I cannot find anything about it at google or at other search machine. So, I've made an application using C++ and QtCreator. I 've made a new mime type for application's project files. My system (ubuntu 10.10), when I right click a file and I... (3 Replies)
Discussion started by: hakermania
3 Replies

6. Shell Programming and Scripting

perform 3 awk commands to multiple files in multiple directories

Hi, I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them. Each of... (20 Replies)
Discussion started by: amarn
20 Replies

7. UNIX for Dummies Questions & Answers

multiple text edits inone pass

File_1 looks like: bunch of text Untitled Placemark bunch of text bunch of text Untitled Placemark bunch of text bunch of text Untitled Placemark bunch of text File_2 looks like: Title_001 Title_002 Title_003 First: I need to replace the 1st occurence of "Untitled Placemark"... (2 Replies)
Discussion started by: kenneth.mcbride
2 Replies

8. Shell Programming and Scripting

How to automatically pass 'multiple' user inputs

Hi Everyone, 1) I really cannot figure out how to pass multiple user inputs in a script. really need your help re this. below is the script. ----------- #!/bin/sh # script name: ask.sh echo "Enter name: \c" read NAME echo "Your name is $NAME\n" echo "Enter age: \c" read AGE echo... (5 Replies)
Discussion started by: mcoblefias
5 Replies

9. Shell Programming and Scripting

Is is possible to pass multiple entries in PS3 select ?

PS3="Enter corresponding number and hit enter:" select DIR in `cat mylist` QUIT do if then echo "INVALID INPUT" else if ; then my commands ..... else break fi fi REPLY='' done The above will return something like below : Select from the list of... (4 Replies)
Discussion started by: ningy
4 Replies

10. Shell Programming and Scripting

Help with bash script to open arbitrary # of independent xterms

I run multiple processes that require I pop open multiple xterms, how can I do this in a script and have each xterm colored differently and labled for the servername they represent, for example if I do ssh username@serverip I would need the xterm to be opened with that servername at the top and... (3 Replies)
Discussion started by: smth333
3 Replies
sudo_root(8)						      System Manager's Manual						      sudo_root(8)

NAME
sudo_root - How to run administrative commands SYNOPSIS
sudo command sudo -i INTRODUCTION
By default, the password for the user "root" (the system administrator) is locked. This means you cannot login as root or use su. Instead, the installer will set up sudo to allow the user that is created during install to run all administrative commands. This means that in the terminal you can use sudo for commands that require root privileges. All programs in the menu will use a graphical sudo to prompt for a password. When sudo asks for a password, it needs your password, this means that a root password is not needed. To run a command which requires root privileges in a terminal, simply prepend sudo in front of it. To get an interactive root shell, use sudo -i. ALLOWING OTHER USERS TO RUN SUDO
By default, only the user who installed the system is permitted to run sudo. To add more administrators, i. e. users who can run sudo, you have to add these users to the group 'admin' by doing one of the following steps: * In a shell, do sudo adduser username admin * Use the graphical "Users & Groups" program in the "System settings" menu to add the new user to the admin group. BENEFITS OF USING SUDO
The benefits of leaving root disabled by default include the following: * Users do not have to remember an extra password, which they are likely to forget. * The installer is able to ask fewer questions. * It avoids the "I can do anything" interactive login by default - you will be prompted for a password before major changes can happen, which should make you think about the consequences of what you are doing. * Sudo adds a log entry of the command(s) run (in /var/log/auth.log). * Every attacker trying to brute-force their way into your box will know it has an account named root and will try that first. What they do not know is what the usernames of your other users are. * Allows easy transfer for admin rights, in a short term or long term period, by adding and removing users from the admin group, while not compromising the root account. * sudo can be set up with a much more fine-grained security policy. * On systems with more than one administrator using sudo avoids sharing a password amongst them. DOWNSIDES OF USING SUDO
Although for desktops the benefits of using sudo are great, there are possible issues which need to be noted: * Redirecting the output of commands run with sudo can be confusing at first. For instance consider sudo ls > /root/somefile will not work since it is the shell that tries to write to that file. You can use ls | sudo tee /root/somefile to get the behaviour you want. * In a lot of office environments the ONLY local user on a system is root. All other users are imported using NSS techniques such as nss-ldap. To setup a workstation, or fix it, in the case of a network failure where nss-ldap is broken, root is required. This tends to leave the system unusable. An extra local user, or an enabled root password is needed here. GOING BACK TO A TRADITIONAL ROOT ACCOUNT
This is not recommended! To enable the root account (i.e. set a password) use: sudo passwd root Afterwards, edit the sudo configuration with sudo visudo and comment out the line %admin ALL=(ALL) ALL to disable sudo access to members of the admin group. SEE ALSO
sudo(8), https://wiki.ubuntu.com/RootSudo February 8, 2006 sudo_root(8)
All times are GMT -4. The time now is 08:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy