Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
SSH and remote execution
Name: Bill Hubbard Date: February 21, 2003 at 13:11:52 Pacific OS: hp11.0 CPU/Ram: 8 p900/8gb
Comment:
I am new to SecureShell but I'm learning...I need to know how to execute a script on a remote machine from a local machine where the script lives...For example, my script is called "vg_report.sh" and it lives on server "local"...I want to run the "vg_report.sh" script on machine "remote"...
From the documentation that I can find it appears that all I'd have to do is from the "local" machine type:
ssh remote vg_report.sh
but when I turn on verbose logging I can see that it successfully makes the connection to "remote", but it can't find "vg_report.sh" so that tells me that it's looking for the file on the remote machine...
Any ideas or suggestions would be greatly appreciated!!
Name: Jimbo Date: February 22, 2003 at 06:23:08 Pacific
Reply:
The file must also reside on the remote machine. you can use 'scp' to copy the file to the remote server and then 'ssh' to execute it.
-jim
0
Response Number 2
Name: jaha Date: February 25, 2003 at 05:02:27 Pacific
Reply:
Ich haven't try it, but i think it should work ;-)
cat vg_report.sh | ssh "remote /bin/sh -"
0
Response Number 3
Name: Bill Hubbard Date: February 27, 2003 at 08:50:14 Pacific
Reply:
Thanks for the replies...Your suggestion worked great Jaha...Now I have another question:
When I scp or ssh to a remote server, is there anyway to suppress the .profile information?? I just want to ssh to a remote machine and only see the unix prompt at the remote location and nothing else...
Summary: Hi, Can anyone help me with the following problem? I am working at home on my PC (with Windows XP prof) while I'm also logged in onto an UNIX machine through SSH and Exceed 7.1. The problem is that wh...
Summary: Hi guys, thanks for the responses. The reason why I need to do it in java and remotely is because I'm writing a JSP page for users. I don't want the users to have direct access to the unix server but ...
Summary: In your script on A server(bk.sh): 1. DYNAMICALLY create a scrip(archive.sh) which archives the will-be-overwritten existing files on the B server 2. scp archive.sh to B server 3. ssh (remote execute)...