AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  *need help in telnet connection:*

    Posted Thu July 10, 2008 06:56 AM

    Originally posted by: SystemAdmin


    I have 2 servers

    test1
    production2
    <hr />

    i have script called naveed2.sh in test1.Actually i m trying to connect from scritp naveed2.sh into server production2.

    below the contents of script naveed2.sh

    #!/bin/ksh

    telnet production2.com< n2.txt
    <hr />

    Actually the problem is how to pass username and password of production2 from script naveed2.sh ?????
    #AIX-Forum


  • 2.  Re: *need help in telnet connection:*

    Posted Thu July 10, 2008 07:37 AM

    Originally posted by: orphy


    I don't know what n2.txt is but if it's a script, you might consider using ssh, rsh, or rexec instead of telnet. Telnet is generally used for interactive sessions.
    Orphy
    #AIX-Forum


  • 3.  Re: *need help in telnet connection:*

    Posted Thu July 10, 2008 08:03 AM

    Originally posted by: SystemAdmin


    n2.txt contains the username and password.

    so i m passing through that script.

    my intention is to login to remote server production2 from a script(naveed2.sh) in a host server test1 and perform some functions in remote server production2 .
    i thought of using telnet as someone suggested me. if this is not possible with telnet what to use and how to use it?
    #AIX-Forum


  • 4.  Re: *need help in telnet connection:*

    Posted Fri July 11, 2008 02:08 AM

    Originally posted by: orphy


    Look at the man pages for rcp and rexec. If you are interested in a more secure way of doing this, Google scp.
    Orphy
    #AIX-Forum


  • 5.  Re: *need help in telnet connection:*

    Posted Fri July 11, 2008 02:13 AM

    Originally posted by: orphy


    Sorry, I meant Google ssh, not scp. Somehow, I can't edit the message after I posted it.

    To me, you should spend the time to learn about setting up ssh for this since you are hitting a production server from a test box. It's never a good idea to put your login/password in a plain text file!!!

    Orphy
    #AIX-Forum


  • 6.  Re: *need help in telnet connection:*

    Posted Thu July 10, 2008 01:40 PM

    Originally posted by: kappa


    hi,

    use telnet as part of an expect script (advanced sysadmin)
    or
    better: use ssh/scp with rsa krypto keys (password not necessary)
    #AIX-Forum