1830467 Members
2555 Online
110005 Solutions
New Discussion

Remote SH

 
SOLVED
Go to solution
Miguel Carabano_1
Regular Advisor

Remote SH

Hi,

How i can execute from host1 to host2 remote shell, rsm ???

Thanks
7 REPLIES 7
Peter Nikitka
Honored Contributor

Re: Remote SH

Hi,

use - if installed -
ssh host2 'command1;command2'

or else
remsh host2 'command1;command2'

It's worth to read 'man ssh' / 'man remsh' .

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Ninad_1
Honored Contributor

Re: Remote SH

Login to host1 and execute
remsh host2 "command to execute"

Do a man remsh.
Also there are a few things. remshd must be there in /etc/inetd.conf
do man remshd

Also on host2 you need to create a file if not already existing - /etc/hosts.equiv and add an entry for the host1 and user that will be using remsh as follows
host1 username
OR
host1 + [ if you want all users of host1 to be allowed to execute remote commands without password]

Regards,
Ninad
Miguel Carabano_1
Regular Advisor

Re: Remote SH

Hi,

I have installed:
T1471AA A.04.20.005 HP-UX Secure Shell

And, i need ssh to other user, not for root!

Step 1:
Logon as user
Step 2:
ssh-keygen -t rsa

But i don't know more...

Help! Please.

Thanks
Peter Nikitka
Honored Contributor
Solution

Re: Remote SH

Hi,

ok, you use ssh, but
I must really guess to get what you want to achieve:

- executing remote command, but without supplying a password?
=> setup authentication (you chose rsa)
=> exchange auth-keys in appending user1@host1:.ssh/isd_rsa.pub to user2@host2:.shh/authorized_keys

- executing a remote command as a different remote user?
=> ssh user2@hosts2 'command1;command2'

- both requests together?


I suggest, really to read the manpage for ssh.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Alex Lavrov.
Honored Contributor

Re: Remote SH

You can use "rexec" too.

http://www.datafocus.com/docs/man1/rexec.1.asp


But consider use of secure shell and it's tilities.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Sheriff Andy
Trusted Contributor

Re: Remote SH

Follow this document. It is from off of one of the forums.

then do the

ssh user@system command
Miguel Carabano_1
Regular Advisor

Re: Remote SH

Thanks Team!

MC