- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: execute script on other UNIX machine?? how
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 02:00 AM
06-29-2006 02:00 AM
execute script on other UNIX machine?? how
how can I use or can I use rlogin or rsh to execute script
script is on: /path/to/script/script
ip address of machine that should be accessed is 192.168.168.5
username: user1
pass: userpass
Any help is appretiated...thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 02:13 AM
06-29-2006 02:13 AM
Re: execute script on other UNIX machine?? how
First, you need to establish a 'hosts.equiv' or '.rhosts' file on both servers. See the manpages for 'hosts.equiv(4)' for this.
You will also want to make sure the '/etc/inetd.conf' has the 'login', 'shell' and 'exec' services enabled.
The manpages for 'remsh(1)' offer additional information for you.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 01:59 PM
06-29-2006 01:59 PM
Re: execute script on other UNIX machine?? how
I use .rhosts, it seems easier to setup then hosts.equiv. Make sure that the .rhost is in the home directory of the user.
The man pages for .rhosts is very good and will show you exactly how to set it up.
If you are at all interested in Sarbens Oxly, they kind of frown on this. If you setup your .rhosts completely, you can usually talk them out of it. So make sure that you not only have the system name but also the user name in the .rhosts.
Here is an example of a command
remsh hp1 -n "/sbin/init.d/sendmail stop"
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 05:33 PM
06-29-2006 05:33 PM
Re: execute script on other UNIX machine?? how
Do I need to edit those files??
rsh and rlogin work already...I just can not figure how to add those commands to my script?? so it can run automaticly when I start my script...
thanks..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 08:25 PM
06-29-2006 08:25 PM
Re: execute script on other UNIX machine?? how
octant:/home/vbe $ remsh mairan "date"
Fri Jun 30 10:22:23 METDST 2006
octant:/home/vbe $
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 10:19 PM
06-29-2006 10:19 PM
Re: execute script on other UNIX machine?? how
I want in my shell script among other thing to write so that machine can connect to other machine and execute script in other machine...
I can do it in commands..
rlogin IPaddress
then I am asked for pass. and bingo I am on other machine then change dir. and execute script...
But I want it in first machine to have all that in shell script so I just execute script on machine A...machine does login to machine B and execute script on amchine B...of course while I am on machine A..
Please sorry if I confused U but could not figure easyer way to explan U..
Thanks for help..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 11:07 PM
06-29-2006 11:07 PM
Re: execute script on other UNIX machine?? how
the script needs to be accessible on hostB when you execute it:
In this script fragment called from your sun
...
thishost=sun
hphost=hp
rsh $hphost /path/to/script/script
echo fini on $hphost
...
the pathname '/path/to/script/script' gets resolved on $hphost.
If this is not the case, you'll have to transfer this file to $hphost first and then call the requested interpreter (e.g. perl, ksh):
...
thishost=sun
rcp /path/to/script/script $hphost:/tmp
rsh $hphost 'ksh /tmp/script'
echo fini on $hphost
...
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2006 12:26 AM
06-30-2006 12:26 AM
Re: execute script on other UNIX machine?? how
From 'man remsh':
The remote account name used is the same as your local account name, unless you specify a different remote name with the -l option. In addition, the remote host account name must also conform to other rules which differ depending upon whether the remote host is operating in a Kerberos V5 Network Authentication, i.e., secure environment or not. In a non-secure, or traditional environment, the remote account name must be equivalent to the originating account; no provision is made for specifying a password with a command. For more details about equivalent hosts and how to specify them, see hosts.equiv(4). The files inspected by remshd on the remote host are /etc/hosts.equiv and $HOME/.rhosts (see remshd(1M)).
So you should not be prompted for a password when you 'rlogin' or 'rsh'. If you are, ~/.rhosts is not configured correctly and/or you are not logging in as the proper user. You must fix this, as "no provision is made for specifying a password with a command". To log in as a different remote user:
# rsh
So in your script, you would put:
#!/usr/bin/sh
rsh hpux_server -l user1 -n /scripts/script_to_run.sh
echo "Done."
Note that '/scripts/script_to_run.sh' is on the remote server.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2006 01:18 AM
06-30-2006 01:18 AM
Re: execute script on other UNIX machine?? how
#!/usr/bin/sh
rsh 192.168.129.85 -n /fileOn/other/machine/script
I get Permission denied.
I am new in solaris world..so..please any explanation is very very welcome..:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2006 02:17 AM
06-30-2006 02:17 AM
Re: execute script on other UNIX machine?? how
you MUST have passwordless connections from hostA to hostB for a successful call of
rsh hostB 'command' (on HP-UX read: remsh ...)
There is no difference there between SUN, HP, ...
When you have setup this - do like the other collegues in the forum told - this will succeed.
If you want to have interactive entering a psssword with remoute command execution, use 'ssh'.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2006 02:19 AM
06-30-2006 02:19 AM
Re: execute script on other UNIX machine?? how
you MUST have passwordless connections from hostA to hostB for a successful call of
rsh hostB 'command' (on HP-UX read: remsh ...)
There is no difference there between SUN, HP, ...
When you have setup this - do like the other collegues in the forum told - this will succeed.
If you want to have interactive entering a password with remote command execution, use 'ssh'.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2006 02:27 AM
06-30-2006 02:27 AM
Re: execute script on other UNIX machine?? how
you MUST have setup passwordless connections from hostA to hostB for a successful call of
rsh hostB 'command' (on HP-UX read: remsh ...)
There is no difference there between SUN, HP, ...
When you have setup that - do it like the other collegues in the forum told you - this call will succeed.
If you want to have interactive entering a password with remote command execution, use 'ssh'.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2006 02:32 AM
06-30-2006 02:32 AM