Operating System - HP-UX
1832143 Members
3012 Online
110038 Solutions
New Discussion

connect to a remote system

 
SOLVED
Go to solution
Anand_30
Regular Advisor

connect to a remote system

Hi,

I am writing a script which needs connecting to a remote system. I want the username and the password to be supplied in the command line. I cannot use rlogin because i do not have permissions for .rhosts in both the servers. Is there any other way in which this can be achieved.

Thanks,
Andy
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: connect to a remote system

Good. Don't use rlogin.


Secureshell will do the job. An admin will have to install it for you.
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

ssh replaces rlogin/telnet
sftp replaces ftp
scp replaces rcp

You can even exchange public keys between servers and do it without password.

See attached document.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Paddy_1
Valued Contributor

Re: connect to a remote system

Use a expect script.It needs Tcl to be in place. Then use something like

-------------
#!/usr/bin/expect

set args [llength $argv]
set system [lindex $argv 0]
set login [lindex $argv 1]
set password [lindex $argv 2]

expect "login"
send "$login\r"
expect "password"
send "$password\r"
interact
------------------
The start using it like

logon aurora myaccount mypasswd

Hope this helps
The sufficiency of my merit is to know that my merit is NOT sufficient
Dave La Mar
Honored Contributor

Re: connect to a remote system

Andy -
Investigate remesh as well.

Best regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Alzhy
Honored Contributor

Re: connect to a remote system

Anand,
SecureShell is your best bet as it negates the transmission of cleartext and encrypts your data stream. Plus with keys - you can initiate interserver commnunications without supplying a password.
.
It is now becoming a standard that FTP and telnet/rlogin be "outlawed" in favor of SSH tools (ssh, sftp, scp, etc...).
Hakuna Matata.
hein coulier
Frequent Advisor

Re: connect to a remote system

rexec ${machine} "${command}"

or ${machine} -l ${username} "${command}"