02-13-2009
Thanks mark54g, but the problem is also that i want to execute scripts that exist on the remote host but the scripts use local variables that exist on the remote host.
Example:
# Remote server
[gacf@server1 ~]$ cat /tmp/runMe.sh
#!/bin/sh
echo $MAIL
[gacf@server1 ~]$ /tmp/runMe.sh
/var/spool/mail/gacf
[gacf@server1 ~]$
# Local server
[brendan@server2 ~]$ ssh gacf@server1 '/tmp/runMe.sh'
/var/mail/gacf
[brendan@server2 ~]$
Any ideas?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using KSH and I need to check whether the remote host has been configured with ssh public key. Is there any way we can check inside a script? (6 Replies)
Discussion started by: praveenbvarrier
6 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Not sure if this is possible, I have a server (SERVER1) that is currently set up as a remote SSH host. My client SSH host (SERVER2) is connecting to SERVER1 to scp a file with no password.
I now have a need to set up a third server (SERVER3) as a remote SSH host and I need SERVER1 as a... (4 Replies)
Discussion started by: tatchel
4 Replies
3. Shell Programming and Scripting
i want a script with expect or perl or shell which will do ssh to remote host...it will take commandline argument and run the script in remote host.......
i.e that will be like ./ssh.exp remoteip username passwd /tmp.kk.sh
can someone help me on this? (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies
4. Shell Programming and Scripting
Hi, could anyone please tell me how to ssh to remote host foo and execute command on it and print the result on local host?
Thanks,
Paresh (1 Reply)
Discussion started by: masaniparesh
1 Replies
5. Solaris
server is ok, I can login on console. however, when I use SSH teachia, there is no repsond.
i have check ps-ef | grep ssh, it shows ok. restart ssh too. still not working.
Anything else I need to check?
# ps -ef | grep ssh
root 24706 1 0 Jun 12 ? 0:00... (7 Replies)
Discussion started by: uuontario
7 Replies
6. Shell Programming and Scripting
Hi all
I wrote a script to execute a script on several remote hosts, but somehow during the execution of the local script, ssh can't come back from the remote host, so that causes my local script hanging... I use the below command to do the job in the local script, any idea?
ssh... (12 Replies)
Discussion started by: bzylg
12 Replies
7. UNIX for Advanced & Expert Users
I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1.
When I do a who -m from A2, I see the "connected from" as "A1".
=> who -m
userid pts/2 2010-03-27 08:47 (A1)
I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies
8. Shell Programming and Scripting
Hi all,
I have a problem where i'm trying to identify on which remote hosts the apps are running, ssh into it and restart them.
In case more than 1 apps is running on same remote host, i want to be able to group it and ssh only once.
E.g:
app1 = 1.1.1.1
app2 = 1.1.1.2
app3 =... (4 Replies)
Discussion started by: varu0612
4 Replies
9. Shell Programming and Scripting
How should i make the following code working
#!/bin/bash
INPUTFILE="test.txt"
while read STRING; do
IP=`host -t A $STRING | awk '{print $NF}'`
HOSTNAME=`ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no $IP "hostname"`
echo $HOSTNAME > out.txt
done < $INPUTFILE
At this moment while... (3 Replies)
Discussion started by: urello
3 Replies
10. IP Networking
I am trying to connect to a remote host C from my node host A.
HostA <====> HostB <====> HostC
A tunnel has already been formed using SOCKS5 between HostA and HostC.
Now I want to SSH from A to C. The SOCKS5 IP us 142.133.132.161 and port 1082.
The command I am using is :
ssh -L... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies
LEARN ABOUT SUNOS
asadmin-delete-instance
asadmin-delete-instance(1AS) User Commands asadmin-delete-instance(1AS)
NAME
delete-instance - deletes the instance that is not running.
SYNOPSIS
delete-instance [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--local=false] [--domain domain_name]
[--passwordfile filename] [--secure|-s]instance_name
Use the delete-instance command to delete the instance that you specify. The delete-instance command can be run both locally and remotely.
To delete the instance locally, not requiring the administration server to be up and running, specify the --local option. To delete the
instance remotely, the administration server must be running on the hostname and port number specified. The user authenticates using the
password identified for the administration server. Additionally, the instance must already exist within the domain served by the adminis-
tration server. Use this command with discretion since it is destructive and there is no undo.
OPTIONS
--user administrative user associated for the instance.
--password administrative password corresponding to the administrative user.
--host host name of the machine hosting the administrative instance.
--port administrative port number associated with the administrative host.
--domain name of the domain.
--local determines if the command should delegate the request to administrative instance or run locally.
--passwordfile file containing passwords appropriate for the command (e.g., administrative instance).
--secure if true, SSL/TLS to communicate with the administrative instance.
OPERANDS
instance_name name of the instance to be deleted.
Example 1: Using delete-instance in local mode
asadmin> delete-instance --domain domain1 server1
Deleted Instance server1 successfully
Where: the server1 instance for the domain1 domain is deleted on the local machine.
Example 2: Using delete-instance in remote mode
asadmin> delete-instance --user admin --passwordfile passwords.txt --host localhost --port 4848 server1
Deleted Instance server1 successfully
Where: the server1 instance for the domain associated with the specified user, passwords in the password file, host, and port number is
deleted on the remote machine.
EXIT STATUS
0 command executed successfully
1 error in executing the command
INTERFACE EQUIVALENT
Server Instance page
asadmin-create-instance(1AS), asadmin-start-instance(1AS), asadmin-stop-instance(1AS), asadmin-restart-instance(1AS)
J2EE 1.4 SDK March 2004 asadmin-delete-instance(1AS)