Operating System - HP-UX
1835051 Members
3145 Online
110073 Solutions
New Discussion

Re: SOme doubts please clarify

 
SOLVED
Go to solution
Karthick K S
Frequent Advisor

SOme doubts please clarify

I have 3 server

i want to login 2nd server from 1st telnet server without using telnet or rlogin or ssh.
7 REPLIES 7
Muthukumar_5
Honored Contributor

Re: SOme doubts please clarify

You must need one login client service has to be invoked to that server. Can you say why you are asking this? It will be good to think on that way.

hth.
Easy to suggest when don't know about the problem!
Karthick K S
Frequent Advisor

Re: SOme doubts please clarify

what my question

Ifi login on Machine A now i want to go to Maching B without telnet or ssh or rsh

ot

I want to run vmstat from Machnine A for Machine B
Muthukumar_5
Honored Contributor
Solution

Re: SOme doubts please clarify

You want to execute a command in Machine2 from Machine1 without login into it. You can use several methods as,

i) Using remsh / rexec

# remsh -l root Machine2 -n "vmstat 5,5" > machine2_vmstat.log

ii) telnet piping:

(
echo "root"
sleep 2
echo ""
sleep 2
echo "vmstat 5,5"
sleep 2
echo "exit"
sleep 1
) | telnet Machine2

Change account name "root" and passwd there in script.

iii) Setup ssh without password prompting:

ssh root@Machine2

iv) Expect scripting

hth.
Easy to suggest when don't know about the problem!
VIKAS AGRAWAL
Frequent Advisor

Re: SOme doubts please clarify

U can do it by command REMSH

for running REMSH remshd Service should be running . This service checked for two files before executing any command i.e /etc/hosts.equiv & .rhosts file in the home directory of user .

One more thing always use the full path at the time of execution of command

hope this will close the issue

Regards

Vikas
Karthick K S
Frequent Advisor

Re: SOme doubts please clarify

i run this remsh but it throwing error

remshd: Login incorrect

and also in my server there is no

/etc/hosts.equiv file
.rhosts in my home dire

pls clarify to me how to go
saju_2
Respected Contributor

Re: SOme doubts please clarify

Hi

There are two ways all "r" (rlogin,rcp etc) commands will work.
One is host equivalancy and other is user equivalency

In host equivlency u make a file /etc/hosts.equiv.

If a remote machin's user name is in that file, that user can access this server, provided a same user name exists in this server.

If a -ve sign with hostname is there in the file then all the users in that machine cannot access this machine

If only a +ve sign is there in this file then all hosts can access this server

In user equivency $HOME/.rhosts is used. It has priority over /etc/hosts.equiv

In .rhosts file put the machine name and user name. Then that user from that particular machine can access this machine.

For eg:

MachineA user1

If there is a +ve sign and a user name then from any machine that user can access this server.

Regards
CS
Karthick K S
Frequent Advisor

Re: SOme doubts please clarify

Thanks lot