Sponsored Content
Top Forums Shell Programming and Scripting Unable to run command after ssh Post 302737209 by saurabh84g on Wednesday 28th of November 2012 01:18:15 PM
Old 11-28-2012
Unable to run command after ssh

Hello,

I am trying to create a ksh script to login to server and collect gather output of some command to troubleshoot some issue.

Code:
DATE=`date +%b.%d.%Y.%M.%H`
echo " Enter emp id to login to server"
read Eid
Eid=$Eid
echo " Enter hostname of the system"
read HOST
HOST=$HOST
/usr/bin/ssh $Eid@$HOST   <===== It is working upto here
OSVALUE=`uname -s|tail -1`
if [ $OSVALUE = Linux ]
then
/usr/bin/sudo su - root
else
/prod/prop/tools/bin/sudo su - root
fi

issue) My script is working upto marked arrow and it is prompting me for password and i am able to login to server, BUT command after that are not running.


pls gelp

I am beginner in scripting. This is ksh

Last edited by Corona688; 11-28-2012 at 02:50 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I get ssh to run a command in one line?

How would I combine something like: localserver# ssh remoteserver remoteserver# find blah blah blah into a one liner that would ssh to the remote server and run the find command, so I could put it in a script to automatically go out and run things on remote servers with out needed user... (2 Replies)
Discussion started by: LordJezo
2 Replies

2. Shell Programming and Scripting

how to run a command in different machine using SSH

how to run a command in different machie in my case script will runs in solaries machine.. in one instance it has to run a command in different machine with different operating system ( linux ) using SSH command i tried ssh -l (login_name) (machine name/host ) " command " but it is... (3 Replies)
Discussion started by: mail2sant
3 Replies

3. Solaris

Unable to run xclock

Hello. I am trying to run xclock on newly built solaris box - These are the steps I followed: # DISPLAY=localhost:0.0 # export DISPLAY # xclock xclock: not found # cd /usr/openwin/bin # ./xclock Error: Can't open display: localhost:0.0 # Please suggest, what am i doing wrong? Thank... (27 Replies)
Discussion started by: panchpan
27 Replies

4. Solaris

Run command on sc via ssh

when i run a command on ALOM via ssh i get following error ssh root@10.23.12.51 showhosts Password: Waiting for daemons to initialize... Daemons ready shell: Invalid credentials how can i run commands without actually loging to the sc (3 Replies)
Discussion started by: fugitive
3 Replies

5. HP-UX

Unable to run some commands in HP-UX

Hi All, I want to get %cpu and %memory utilization for a given process id in HP-UX so am using the following commands 1)TOP -p <PID> am getting error message like Quitting top: pset 26323 doesn't exist,but when am using only TOP command without any options its working fine. 2)ps -e -o pcpu... (5 Replies)
Discussion started by: Ramya_Nm
5 Replies

6. Shell Programming and Scripting

run command with ssh[solved]

Hi all, Is it possible to make this possible ? $ echo $SKY_HOME /var/sink/SKY $ echo $SKY_HOME /home/smily/SKY $ ssh root@xyz "echo $SKY_HOME" root@xyz 's password: ****** /home/smily/SKY wrong output I was expecting the output as /var/sink/SKY (3 Replies)
Discussion started by: linuxadmin
3 Replies

7. Shell Programming and Scripting

Unable to run application using ssh

I'm testing a C++ based application (HLR) in my solaris system. Whenever i start the application remotely from some other solaris server using ssh command the application throws an error and goes down. command i used: ssh root@192.168.151.77 "./start_hlr.sh" Below is the error observed : ... (1 Reply)
Discussion started by: Arun_Linux
1 Replies

8. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

9. UNIX for Dummies Questions & Answers

Unable to run awk command

hello Don Cragun sir, i am not able to run this command awk 'NR==FNR{if($0~/^>/){i=substr($0,2);getline};a=a $0;next}{print ">" $1 ORS substr(a, $2, $3-$2+1)}' file1 FS=\\t file2 i searched do text you on twitter, facebook but i get no reply from over there so i post here. ---------- Post... (2 Replies)
Discussion started by: harpreetmanku04
2 Replies

10. UNIX for Advanced & Expert Users

Run awk command inside ssh

I am trying to run an awk command inside of ssh and it is not working. These are AIX servers. for i in `cat servers`; do ssh $i "/bin/hostname; df -g | awk '/dev/ && $4+0 > 70'"; done server1 server2 server3 server4 I also tried these two methods and they did not work. It just seemed... (5 Replies)
Discussion started by: cokedude
5 Replies
GET TPM PCR 
HASH(8) GET TPM PCR HASH(8) NAME
tpm_getpcrhash SYNOPSIS
tpm_getpcrhash [-r HOST] [-hv] UUID-FILE HASH-FILE PCR-VALUE-FILE PCRS DESCRIPTION
The program returns the signed data produced by a TPM quote in the file HASH-FILE and the list of Platform Configuration Register values in the file PCR-VALUE-FILE. PCRS is a sequence of integers that specify the Platform Configuration Registers used to produce the signed data. The key used for the operation is the one registered under the UUID in UUID-FILE. The nonce used while quoting is unpredictable. The nonce field in the signed data is ignored when using the signed data to verify a quote. -r HOST Perform operation on remote HOST. -h Display command usage info. -v Display command version info. SEE ALSO
tpm_quote_tools(8), tpm_loadkey(8), tpm_getquote(8), tpm_verifyquote(8), tpm_updateprchash(8) Oct 2010 GET TPM PCR HASH(8)
All times are GMT -4. The time now is 06:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy